New ARI warning Wed May 23 01:55:03 UTC 2012

Joel Brobecker brobecker@adacore.com
Fri Jun 22 17:19:00 GMT 2012


> Mark> So I'd have no objection to requiring C99, except for one
> Mark> style-related issue.  I really, really hate mixing declarations with
> Mark> code (something that C99 started to allow).  So if we switch to
> Mark> requiring C99, I think we should add a rule to the coding standards
> Mark> that variables may only be declared at the start of a block.
> 
> If there is no warning for it, then uses will slip in.

Here is a patch that adds -Wdeclaration-after-statement to the list
of compiler warnings...

Tested on x86_64-linux by rebuilding the native compiler with
--enable-targets=all.

gdb/ChangeLog:

        * configure.ac (build_warnings): Add -Wdeclaration-after-statement.
        * configure: Regenerate.

OK to commit?

Thanks,
-- 
Joel



More information about the Gdb-patches mailing list