GNU bug report logs - #4434
add -Wdeclaration-after-statement to CFLAGS if supported

Previous Next

Package: emacs;

Reported by: Dan Nicolaescu <dann <at> ics.uci.edu>

Date: Mon, 14 Sep 2009 19:25:07 UTC

Severity: normal

Tags: patch

Merged with 4261

Done: Dan Nicolaescu <dann <at> ics.uci.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (Emacs bug Tracking System)
To: Dan Nicolaescu <dann <at> ics.uci.edu>
Subject: bug#4434: marked as done (add -Wdeclaration-after-statement to
 CFLAGS if supported)
Date: Fri, 20 Nov 2009 16:35:09 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 20 Nov 2009 08:30:51 -0800 (PST)
with message-id <200911201630.nAKGUpEI024572 <at> godzilla.ics.uci.edu>
and subject line Re: bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported
has caused the Emacs bug report #4434,
regarding add -Wdeclaration-after-statement to CFLAGS if supported
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact help-debbugs <at> gnu.org
immediately.)


-- 
4434: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4434
Emacs Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>
Subject: add -Wdeclaration-after-statement to CFLAGS if supported
Date: Mon, 14 Sep 2009 12:16:16 -0700 (PDT)
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


[Message part 3 (message/rfc822, inline)]
From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 4434-done <at> debbugs.gnu.org
Subject: Re: bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported
Date: Fri, 20 Nov 2009 08:30:51 -0800 (PST)
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:

  > > Stefan, any reason not to check this in?
  > 
  > Try it,

Done. Thanks.

This bug report was last modified 15 years and 265 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.