On Tuesday 11 January 2011, Guenter Knauf wrote: > Am 10.01.2011 21:26, schrieb Stefan Fritsch: > > BTW, gcc has -Wdeclaration-after-statement to catch these things. > > Should we add that to the default warnings enabled in maintainer > > mode? > > +2 - NetWare compiler cant deal with either; > and +1 to treat it even as error rather than warning: > -Werror=declarationafterstatement
The -Werror=... syntax requires a rather recent gcc (definitely 4.x, and x > 0 IIRC). > > BTW. isnt the option without dashes? My 'man gcc' lists: > Wdeclarationafterstatement (C and ObjectiveC only) > Warn when a declaration is found after a statement in a > block. This construct, known from C++, was introduced with ISO C99 > and is by default allowed in GCC. It is not supported by ISO C90 > and was not supported by GCC versions before GCC 3.0. > > Since GCC < 3 didnt support this I assume that then also the above > options are not recognized - so adding them should depend on GCC > version The option is newer than the ability to compile the code. It doesn't appear in the gcc 3.3 doc, so I assume it has been introduced in gcc 3.4. I have now commited a configure check for it. But I don't have a pre-3.4 gcc to test the "no" case. Cheers, Stefan
