This is the mail archive of the
mailing list for the GCC project.
Re: C99 usage in gcc [was Re: build failure on mainline due tojava/expr.c]
On Fri, 30 Jan 2004, Bruce Stephens wrote:
> >> with "-Wall -std=c89" doesn't seem to generate any warnings either.
> > It is a pedwarn, hence you need -pedantic also.
> Which is useful, except that it also complains about:
> #ifdef __cplusplus
> // foo
I doubt the Java front end has any need for that construct. In general it
would probably be better (and facilitate moving code between front ends)
for all front ends to compile with -pedantic (if they have good reasons
for using extensions to C90 present in GCC 2.95, they can use
The specific warning for the case you want is
-Wdeclaration-after-statement. Apart from this specific warning option it
is just like any other nondeprecated extension: documented as an extension
(in C90 mode) in extend.texi and warned for with -pedantic.
Ultimately, to know whether something will work with GCC 2.95 you need to
test it with GCC 2.95, as the general case of warning for anything that
won't work or will work differently with GCC 2.95 isn't feasible.
Joseph S. Myers