Newer gcc silently accepts mixing C Code and Declarations

Christian Stimming stimming at tuhh.de
Fri Aug 1 17:05:35 CDT 2003


One month ago I posted that message about gcc3.3 accepting declarations 
after statements in C code 
http://lists.gnucash.org/pipermail/gnucash-devel/2003-July/009485.html . 
Nobody seemed to respond on the list (only one private respone). 
However, one guy picked up this issue and brought it to the gcc mailing 
list. As it now turns out, the gcc guys agreed to include a warning 
switch for this single purpose. Their CVS ChangeLog now says

2003-07-28  Hans-Peter Nilsson  <hp at bitrange.com>
             Michael Culbertson  <Michael.J.Culbertson at wheaton.edu>

         * c.opt (Wdeclaration-after-statement): New.
         * c-opts.c (c_common_handle_option) <case
         OPT_Wdeclaration_after_statement>: New.
         * doc/invoke.texi (Option Summary): Document
         -Wdeclaration-after-statement.

This is quite cool, especially the part that I didn't have to deal with 
the gcc mailing list -- Michael Culbertson was so kind to pick up the 
issue and bring it up there. Obviously he now succeeded so that future 
gcc releases (probably gcc-3.3.1) will have a warning switch to avoid 
such errors. Thanks a lot, Michael!

Christian



More information about the gnucash-devel mailing list