[perl #50908] [CAGE] gcc -Werror=declaration-after-statement

Will Coleda via RT parrotbug-followup at parrotcode.org
Fri Nov 21 16:42:51 UTC 2008


On Wed Sep 24 18:04:31 2008, cotto wrote:
> On Wed Sep 24 10:47:16 2008, cotto wrote:
> > On Mon Feb 18 18:07:43 2008, coke wrote:
> > > On Feb 18, 2008 8:39 PM, chromatic <chromatic at wgz.org> wrote:
> > > > On Friday 15 February 2008 11:35:04 Will Coleda wrote:
> > > >
> > > > > According to http://gcc.gnu.org/onlinedocs/index.html#DIR, 
looks
> like
> > > > > as of gcc 4.2.3 (but not 4.1.2), we can use the following 
option to
> > > > > gcc:
> > > > >
> > > > > -Werror=declaration-after-statement
> > > > >
> > > > > To help enforce our C89 compliance by causing this particular
> style to
> > > > > become an error instead of just a warning. This should be 
added as a
> > > > > default to the build options if a recent enough version of gcc 
is
> > > > > available.
> > > >
> > > > Works for me with gcc 4.1.3; I think this is closeable.
> > > >
> > > > -- c
> > > >
> > > >
> > > 
> > > It's not checked in anywhere, though. We're just using
> > > 
> > > -Wdeclaration-after-statement
> > > 
> > > not
> > > 
> > > -Werror=declaration-after-statement
> > > 
> > 
> > Parrot builds with gcc 4.3.1 just fine when
> > -Werror=declaration-after-statement is added after
> > -Wdeclearation-after-statement in config/auto/warnings.pm .  The 
option
> > shows up in the generated Makefile and in the gcc invocation that's 
used.
> > Adding this line with a gcc that doesn't support
> > -Werror=declaration-after-statement doesn't cause any problems.  It
> > looks like this can safely be integrated into the build process.
> > Once such a change is committed, this ticket can be closed.  I'll do
> > this tonight if nobody beats me to it.
> 
> This option was added in r31396.  I'll be keeping an eye on smolder in
> case this breaks anything, but I'm also resolving the ticket.  It can 
be
> reopened if needed.

Reopening ticket.

This doesn't seem to have any affect on feather (using gcc 4.3.2-1); if 
I deliberately add in a failure to, say, src/string.c and then build 
src/string.o, the warning is triggered, but not the error. src/string.o 
is still generated.

I can see the -Werror= ... in the compiler flags, but it doesn't seem to 
actually make it an error.

-- 
Will "Coke" Coleda


More information about the parrot-dev mailing list