This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: New ARI warning Wed May 23 01:55:03 UTC 2012
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Mark Kettenis <mark dot kettenis at xs4all dot nl>, dje at google dot com, pierre dot muller at ics-cnrs dot unistra dot fr, gdb-patches at sourceware dot org
- Date: Fri, 22 Jun 2012 10:19:22 -0700
- Subject: Re: New ARI warning Wed May 23 01:55:03 UTC 2012
- References: <20120523015503.GA25312@sourceware.org> <m3r4ubo7j0.fsf@redhat.com> <CADPb22QBYSRjoqrgX7p0d5KdAZ+kEk4Ga2YrfHMrm_t_yKCE6w@mail.gmail.com> <CADPb22QOSCV240MV2m0KmsXfNb9O5_WsA+7Jsjn1UJwigaNTrQ@mail.gmail.com> <4fbc9d77.0853b40a.641e.ffff90dbSMTPIN_ADDED@mx.google.com> <CADPb22Qi0Zda439aieEGu26+GWf0y8XzBUkcpg-Kw1BUcjvPNA@mail.gmail.com> <87bold8l4d.fsf@fleche.redhat.com> <201205282043.q4SKhksB010254@glazunov.sibelius.xs4all.nl> <87ipejib8o.fsf@fleche.redhat.com>
> 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