home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / vms / 21768 < prev    next >
Encoding:
Text File  |  1993-01-23  |  1.8 KB  |  44 lines

  1. Newsgroups: comp.os.vms
  2. Path: sparky!uunet!haven.umd.edu!decuac!pa.dec.com!engage.pko.dec.com!e2big.mko.dec.com!adserv.enet.dec.com!winalski
  3. From: winalski@adserv.enet.dec.com (Paul S. Winalski)
  4. Subject: Re: C problem
  5. Message-ID: <1993Jan22.181543.26223@e2big.mko.dec.com>
  6. Lines: 31
  7. Sender: usenet@e2big.mko.dec.com (Mr. USENET)
  8. Reply-To: winalski@adserv.enet.dec.com (Paul S. Winalski)
  9. Organization: Digital Equipment Corporation, Nashua NH
  10. References:  <9301201500.AA20662@anon.penet.fi>
  11. Date: Fri, 22 Jan 1993 18:15:43 GMT
  12.  
  13.  
  14. In article <9301201500.AA20662@anon.penet.fi>, an6034@anon.penet.FI writes:
  15. |>
  16. |>I have a very simple C question.  I have a sample C program that compiles and
  17. |>runs fine in a Borland C++ environment.
  18. |>
  19. |>When I try to compile this program in a VAX/VMS (5.4-2) environment I get a
  20. |>warning message.  I have looked up the error message but it doesn't mean a
  21. |>thing to me.
  22. |>
  23. |>Attached is the source and a sethost log of my compile.
  24. |>
  25. |>Please help a student with out a clue?
  26. |>
  27. |>********************************************************************************
  28. |>cc example_1.c
  29. |>    void main(void){ /* begin main */
  30. |>%CC-W-INVMAINRETVAL, Return value of main function is not an integer type.
  31. |>        At line number 8 in $DISK:EXAMPLE_1.C;24.
  32. |>
  33. |>%CC-I-SUMMARY, Completed with 0 error(s), 1 warning(s), and
  34. |>        0 informational messages.
  35. |>        At line number 29 in $DISK:EXAMPLE_1.C;24.
  36. |>********************************************************************************
  37.  
  38. A C main program must return a value of integer type.  As the error message
  39. states, it is not legal in C to have a main program that does not return a
  40. value.  This works on Borland C++ either because it's a Borland extension to
  41. the C language or because this is one of the differences between C anc C++.
  42.  
  43. --PSW
  44.