From: Dan Nicolaescu <dann@ics.uci.edu>
To: bug-gnu-emacs <bug-gnu-emacs@gnu.org>
Subject: bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported
Date: Mon, 14 Sep 2009 12:16:16 -0700 (PDT) [thread overview]
Message-ID: <200909141916.n8EJGGJJ023826@godzilla.ics.uci.edu> (raw)
Recently we've had a few instances of declarations being added in the
middle of a block.
gcc has a flag to warn about this.
Here's a patch to add this flag to CFLAGS (it mirrors what we already do
for -Wno-pointer-sign).
OK to check in?
Index: configure.in
===================================================================
RCS file: /cvsroot/emacs/emacs/configure.in,v
retrieving revision 1.607
diff -u -3 -p -u -p -r1.607 configure.in
--- configure.in 23 Aug 2009 02:15:00 -0000 1.607
+++ configure.in 14 Sep 2009 18:46:36 -0000
@@ -757,6 +757,19 @@ CFLAGS="$SAVE_CFLAGS"
unset has_option
unset SAVE_CFLAGS
+### Use -Wdeclaration-after-statement if the compiler supports it
+AC_MSG_CHECKING([whether gcc understands
-Wdeclaration-after-statement])
+SAVE_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wdeclaration-after-statement"
+AC_TRY_COMPILE([], [], has_option=yes, has_option=no,)
+if test $has_option = yes; then
+ C_WARNINGS_SWITCH="-Wdeclaration-after-statement $C_WARNINGS_SWITCH"
+fi
+AC_MSG_RESULT($has_option)
+CFLAGS="$SAVE_CFLAGS"
+unset has_option
+unset SAVE_CFLAGS
+
#### Some other nice autoconf tests.
dnl checks for programs
next prev reply other threads:[~2009-09-14 19:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200911201630.nAKGUpEI024572@godzilla.ics.uci.edu>
2009-08-25 23:16 ` bug#4261: make gcc warn about c99 declarations Dan Nicolaescu
2009-11-20 16:35 ` bug#4261: marked as done (make gcc warn about c99 declarations) Emacs bug Tracking System
2009-09-14 19:16 ` Dan Nicolaescu [this message]
2009-11-19 16:55 ` bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported Dan Nicolaescu
2009-11-19 21:09 ` Stefan Monnier
2009-11-20 16:35 ` bug#4434: marked as done (add -Wdeclaration-after-statement to CFLAGS if supported) Emacs bug Tracking System
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200909141916.n8EJGGJJ023826@godzilla.ics.uci.edu \
--to=dann@ics.uci.edu \
--cc=4434@emacsbugs.donarmstrong.com \
--cc=bug-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.