This is the mail archive of the gcc-help@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: Re: function calls before variable declarations does not giveerror in gcc?


Hi Oza,

You're running into a GNU extension to C89, and a standard part of C99.

$ gcc -pedantic -std=c99 -W -Wall -Wno-unused-variable c99.c

No error messages.

$ gcc -pedantic -std=c89 -W -Wall -Wno-unused-variable c99.c
c99.c: In function `main':
c99.c:11: warning: ISO C89 forbids mixed declarations and code

Error messages.

HTH,
--Eljay


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