home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!sun4nl!ittpub.nl!david
- From: david@ittpub.nl (David P. Morgan)
- Newsgroups: comp.os.vms
- Subject: Re: C problem
- Message-ID: <1993Jan22.152307.99@ittpub.nl>
- Date: 22 Jan 93 15:23:06 WET+0100
- References: <9301201500.AA20662@anon.penet.fi>
- Organization: ITT Publitec R+D BV, Amsterdam
- Lines: 40
-
- In article <9301201500.AA20662@anon.penet.fi>, an6034@anon.penet.FI writes:
-
- Why the anonymity ?
-
- > X-Anon-To: INFO-VAX@SRI.COM
- >
- > Hi VAX/VMS experts.
- >
- > I have a very simple C question. I have a sample C program that compiles and
- > runs fine in a Borland C++ environment.
- >
- > When I try to compile this program in a VAX/VMS (5.4-2) environment I get a
- > warning message. I have looked up the error message but it doesn't mean a
- > thing to me.
- >
- > Attached is the source and a sethost log of my compile.
- >
- > Please help a student with out a clue?
- >
- > ********************************************************************************
- > cc example_1.c
- > void main(void){ /* begin main */
- > %CC-W-INVMAINRETVAL, Return value of main function is not an integer type.
- > At line number 8 in $DISK:EXAMPLE_1.C;24.
- >
- > %CC-I-SUMMARY, Completed with 0 error(s), 1 warning(s), and
- > 0 informational messages.
- > At line number 29 in $DISK:EXAMPLE_1.C;24.
-
- Is that an error ? It's a WARNING, like -W- and 1 warning(s) might suggest.
- Jeez, the compiler output couldn't be clearer.
- You got an object file so go ahead and link and run the thing. Next time
- change the main declaration to int (as the "error" message might suggest) or
- omit it (it defaults to int). The reason main should be declared int is so
- that it can pass an exit status back to DCL. And use your name.
-
- --------------------------------------------------------------------------------
- David P. Morgan Internet: david@ittpub.nl |ucannot
- ITT Publitec R+D BV UUCP: ...!sun4nl!ittpub!david|readdis
- Amsterdam PSI: 020412905761212::DAVID |onavt52
-