From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.bugs Subject: bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported Date: Thu, 19 Nov 2009 08:55:34 -0800 (PST) Message-ID: <200911191655.nAJGtYko021413@godzilla.ics.uci.edu> References: <200909141916.n8EJGGJJ023826@godzilla.ics.uci.edu> Reply-To: Dan Nicolaescu , 4434@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1258651487 11093 80.91.229.12 (19 Nov 2009 17:24:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2009 17:24:47 +0000 (UTC) Cc: 4434@emacsbugs.donarmstrong.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 19 18:24:39 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NBAkI-0003AY-By for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Nov 2009 18:24:38 +0100 Original-Received: from localhost ([127.0.0.1]:59974 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBAkH-0002KT-OK for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Nov 2009 12:24:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBATk-0005ey-64 for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 12:07:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBATe-0005b6-42 for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 12:07:30 -0500 Original-Received: from [199.232.76.173] (port=45701 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBATd-0005ag-Lc for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 12:07:25 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:55398) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NBATb-0007EY-WA for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 12:07:24 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAJH7KMH020569; Thu, 19 Nov 2009 09:07:21 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nAJH55DB019785; Thu, 19 Nov 2009 09:05:05 -0800 Resent-Date: Thu, 19 Nov 2009 09:05:05 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Dan Nicolaescu Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 19 Nov 2009 17:05:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4434 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: patch Original-Received: via spool by 4434-submit@emacsbugs.donarmstrong.com id=B4434.125864975518988 (code B ref 4434); Thu, 19 Nov 2009 17:05:05 +0000 Original-Received: (at 4434) by emacsbugs.donarmstrong.com; 19 Nov 2009 16:55:55 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from colin-baker-v0.ics.uci.edu (colin-baker-v0.ics.uci.edu [128.195.1.153]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAJGtswU018985 for <4434@emacsbugs.donarmstrong.com>; Thu, 19 Nov 2009 08:55:55 -0800 Original-Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by colin-baker-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id nAJGtYIp030601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Nov 2009 08:55:34 -0800 Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id nAJGtYko021413; Thu, 19 Nov 2009 08:55:34 -0800 (PST) In-Reply-To: <200909141916.n8EJGGJJ023826@godzilla.ics.uci.edu> (Dan Nicolaescu's message of "Mon, 14 Sep 2009 12:16:16 -0700 (PDT)") Original-Lines: 46 X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: nAJGtYIp030601 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0.521, required 5, autolearn=disabled, ALL_TRUSTED -1.44, URIBL_BLACK 1.96) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 19 Nov 2009 12:07:30 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:32716 Archived-At: Dan Nicolaescu writes: > 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? Stefan, any reason not to check this in? I just run into compilation errors when compiling the current CVS on an old machine that uses gcc-2.96, 3-4 files need fixing. > 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