DevarajA <no@spam.com> writes:
Michael Mair ha scritto: DevarajA wrote:
I've been told that c99 forbids declarations of functions without
return type and defaulting them to return int.
Implicit int is gone from the language with C99, yes.
So why compiling the following code with 'gcc a.c -Wall -std=c99' only
gives a few warnings?
What code?
Sorry, forgot it :-)
--
main(){}
--
Anyway thank you for the info.
You should show us what warnings you got in addition to the code. Not
everyone has gcc; not everyone who has gcc has the same version you
have.
Here's what I get:
% gcc a.c -Wall -std=c99
a.c:1: warning: return type defaults to `int'
The standard requires a diagnostic. It doesn't require the compiler
to reject the program. It doesn't even require the diagnostic to be
meaningful. gcc's behavior is conforming.
--
Keith Thompson (The_Other_Keith)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.