On Fri, March 14, 2008 11:09 am, Phil Dibowitz wrote: > Stephen Warren wrote: >> On Fri, March 14, 2008 2:23 am, Phil Dibowitz wrote: >>> That said, it appears that variables declared not at the top was in >>> fact >>> not >>> part of the c89 spec. But there was definitely pre-ANSI C. >>> >>> I'm annoyed that gcc doesn't get angry about that stuff. It really >>> should. >>> Ah well, I'll fix it up next time I have a few minutes, won't take >>> long. >> >> I seem to recall gcc supported "inline" variable declarations as a gcc >> extension to non-c99 C. Using -ansi might not be enough to get it not >> to. >> Isn't there a -strict or -strict-ansi or -c89/90 flag that does that? > > Yeah - I mentioned it in a later email, -Wdeclaration-after-statement
The problem is, that just generates a warning, which can easily be missed unless one really pays attention to build logs. I was thinking of an option to completely remove the concept of "inline" declarations from gcc's knowledge of syntax, thus forcing an error. It looks like the combination of "-ansi -pedantic" does that. However, enabling -pedantic might cause lots of build failures due to gcc being extremely picky... Unfortunately, I don't see any other option that seems to do this. I guess alternatively -Werror might do the trick, together with the -W you mentioned. That also has some potential for other negative fallout though. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ concordance-devel mailing list concordance-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/concordance-devel