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

  1. Path: sparky!uunet!mcsun!sun4nl!ittpub.nl!david
  2. From: david@ittpub.nl (David P. Morgan)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: C problem
  5. Message-ID: <1993Jan22.152307.99@ittpub.nl>
  6. Date: 22 Jan 93 15:23:06 WET+0100
  7. References: <9301201500.AA20662@anon.penet.fi>
  8. Organization: ITT Publitec R+D BV, Amsterdam
  9. Lines: 40
  10.  
  11. In article <9301201500.AA20662@anon.penet.fi>, an6034@anon.penet.FI writes:
  12.  
  13. Why the anonymity ?
  14.  
  15. > X-Anon-To: INFO-VAX@SRI.COM
  16. > Hi VAX/VMS experts.
  17. > I have a very simple C question.  I have a sample C program that compiles and
  18. > runs fine in a Borland C++ environment.
  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. > Attached is the source and a sethost log of my compile.
  23. > Please help a student with out a clue?
  24. > ********************************************************************************
  25. > cc example_1.c
  26. >     void main(void){ /* begin main */
  27. > %CC-W-INVMAINRETVAL, Return value of main function is not an integer type.
  28. >         At line number 8 in $DISK:EXAMPLE_1.C;24.
  29. > %CC-I-SUMMARY, Completed with 0 error(s), 1 warning(s), and
  30. >         0 informational messages.
  31. >         At line number 29 in $DISK:EXAMPLE_1.C;24.
  32.  
  33. Is that an error ? It's a WARNING, like -W- and 1 warning(s) might suggest.
  34. Jeez, the compiler output couldn't be clearer.
  35. You got an object file so go ahead and link and run the thing. Next time
  36. change the main declaration to int (as the "error" message might suggest) or
  37. omit it (it defaults to int). The reason main should be declared int is so
  38. that it can pass an exit status back to DCL. And use your name.
  39.  
  40. --------------------------------------------------------------------------------
  41. David P. Morgan                        Internet: david@ittpub.nl        |ucannot
  42. ITT Publitec R+D BV                    UUCP:     ...!sun4nl!ittpub!david|readdis
  43. Amsterdam                              PSI:      020412905761212::DAVID |onavt52
  44.