[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc
Subject:    Re: C99 usage in gcc [was Re: build failure on mainline due to
From:       "Joseph S. Myers" <jsm () polyomino ! org ! uk>
Date:       2004-01-31 23:31:37
Message-ID: Pine.LNX.4.58.0401312326020.25940 () digraph ! polyomino ! org ! uk
[Download RAW message or body]

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
> #endif

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
__extension__).

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
jsm@polyomino.org.uk
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic