This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc (lack of) return type warnings


Tobias Pflug <tobias.pflug@exorbyte.com> writes:

> This will compile just fine. When compiled with -Wall it will at least
> bring up a warning about the missing return statement in foo(), nothing
> about main tho either. Or is there some standard that implicitly declares
> main to return 0 when there is no explicit return statement?

If the return value of a function is never used then it is perfectly valid
to fall through the end of it.  For main, the default action is to return
0 since C99.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]