From unknown Sat Sep 06 09:45:55 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported Reply-To: Dan Nicolaescu , 4434@debbugs.gnu.org Resent-From: Dan Nicolaescu Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Mon, 14 Sep 2009 19:25:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 4434 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125295590627865 (code B ref -1); Mon, 14 Sep 2009 19:25:07 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 14 Sep 2009 19:18:26 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.6 required=4.0 tests=AWL,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8EJIOEL027862 for ; Mon, 14 Sep 2009 12:18:25 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MnH4C-0004yL-0r for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 15:18:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MnH47-0004t9-Qz for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 15:18:23 -0400 Received: from [199.232.76.173] (port=34886 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnH47-0004sm-03 for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 15:18:19 -0400 Received: from barrelv2.ics.uci.edu ([128.195.1.114]:46775) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1MnH42-0003Hm-Ro for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 15:18:15 -0400 Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by barrelv2.ics.uci.edu (8.13.8+Sun/8.13.8) with ESMTP id n8EJGGwD005684 for ; Mon, 14 Sep 2009 12:16:16 -0700 (PDT) Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n8EJGGJJ023826; Mon, 14 Sep 2009 12:16:16 -0700 (PDT) Date: Mon, 14 Sep 2009 12:16:16 -0700 (PDT) Message-Id: <200909141916.n8EJGGJJ023826@godzilla.ics.uci.edu> From: Dan Nicolaescu To: bug-gnu-emacs Lines: 40 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: n8EJGGwD005684 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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 From lekktu@gmail.com Thu Oct 22 02:35:31 2009 Received: (at control) by emacsbugs.donarmstrong.com; 22 Oct 2009 09:35:32 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=AWL,MISSING_SUBJECT, MURPHY_DRUGS_REL8,NOSUBJECT,VALID_BTS_CONTROL autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail-fx0-f213.google.com (mail-fx0-f213.google.com [209.85.220.213]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9M9ZTNW004084 for ; Thu, 22 Oct 2009 02:35:31 -0700 Received: by fxm9 with SMTP id 9so9696363fxm.1 for ; Thu, 22 Oct 2009 02:35:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=8EmqKmTQZFxRHmBqMf0mAHPBq3MFliknc0lztWoJq6Y=; b=HxQYupT4FFltZz1ItMJj0h3XTFYNK5e7ryT0Cek2T3YESYQLNQM8G9V9i2CKiMAEbc EvYuLj8f7w1qApk14qvzihjcYCGQUOU+1DBevO5UhGKLQhzQ6+vBiuihHNGFYaXeeEYe kJYg0CmwEGM5xp9e/Qz4pt4br7Ml4TcpNJkWo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=Y5ybjjcxlLdLgAFAm7oQwPF4q6enZ/vhDgoBesbKLPsYfKZBy2gNxuVUArd1lZsA9C Mqc9bcUQhekOxrkhuBrM/oRLNjZDm8m0DPtCnEMhvvK6rKfs9H9j6QMJR6VObUwlfUeo 7VB35jQ8OYFrwvpcsbgPdQA8bmjmcb1XFRU14= MIME-Version: 1.0 Received: by 10.239.145.8 with SMTP id q8mr761204hba.122.1256204124158; Thu, 22 Oct 2009 02:35:24 -0700 (PDT) From: Juanma Barranquero Date: Thu, 22 Oct 2009 11:35:04 +0200 Message-ID: Subject: To: control@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 reassign 4326 emacs,ns merge 4261 4434 merge 1589 3359 4207 merge 3829 4077 tags 4781 + patch tags 4747 + patch tags 4579 + patch tags 4471 + patch tags 4434 + patch tags 4234 + patch tags 4221 + patch tags 4147 + patch tags 4144 + patch tags 4139 + patch tags 4023 + patch tags 4736 + moreinfo unreproducible tags 4547 + notabug tags 4451 + notabug tags 4448 + moreinfo tags 4427 + moreinfo tags 4373 + notabug tags 4360 + notabug tags 4271 + moreinfo tags 4236 + moreinfo tags 4143 + moreinfo unreproducible tags 4120 + moreinfo unreproducible tags 4070 + moreinfo unreproducible severity 4422 wishlist severity 4396 minor severity 4394 minor severity 4341 wishlist severity 4300 minor severity 4263 minor severity 4178 minor severity 4172 wishlist severity 4110 wishlist severity 4056 wishlist close 4772 close 4700 close 4599 close 4515 close 4463 close 4445 close 4395 close 4334 close 4289 close 4219 quit From unknown Sat Sep 06 09:45:55 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported Reply-To: Dan Nicolaescu , 4434@debbugs.gnu.org Resent-From: Dan Nicolaescu Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 19 Nov 2009 17:05:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 4434 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: patch Received: via spool by 4434-submit@emacsbugs.donarmstrong.com id=B4434.125864975518988 (code B ref 4434); Thu, 19 Nov 2009 17:05:05 +0000 Received: (at 4434) by emacsbugs.donarmstrong.com; 19 Nov 2009 16:55:55 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-5.3 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8,URIBL_BLACK,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 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 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 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) Date: Thu, 19 Nov 2009 08:55:34 -0800 (PST) Message-Id: <200911191655.nAJGtYko021413@godzilla.ics.uci.edu> From: Dan Nicolaescu To: Stefan Monnier Cc: 4434@debbugs.gnu.org References: <200909141916.n8EJGGJJ023826@godzilla.ics.uci.edu> In-Reply-To: <200909141916.n8EJGGJJ023826@godzilla.ics.uci.edu> (Dan Nicolaescu's message of "Mon, 14 Sep 2009 12:16:16 -0700 (PDT)") Lines: 46 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 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 From unknown Sat Sep 06 09:45:55 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported Reply-To: Stefan Monnier , 4434@debbugs.gnu.org Resent-From: Stefan Monnier Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 19 Nov 2009 21:15:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 4434 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: patch Received: via spool by 4434-submit@emacsbugs.donarmstrong.com id=B4434.125866494614447 (code B ref 4434); Thu, 19 Nov 2009 21:15:03 +0000 Received: (at 4434) by emacsbugs.donarmstrong.com; 19 Nov 2009 21:09:06 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.9 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from chene.dit.umontreal.ca (chene.dit.umontreal.ca [132.204.246.20]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAJL94Rv014444 for <4434@emacsbugs.donarmstrong.com>; Thu, 19 Nov 2009 13:09:05 -0800 Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id nAJL93mS013319; Thu, 19 Nov 2009 16:09:03 -0500 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 5F2193A0FA; Thu, 19 Nov 2009 16:09:03 -0500 (EST) From: Stefan Monnier To: Dan Nicolaescu Cc: 4434@debbugs.gnu.org Message-ID: References: <200909141916.n8EJGGJJ023826@godzilla.ics.uci.edu> <200911191655.nAJGtYko021413@godzilla.ics.uci.edu> Date: Thu, 19 Nov 2009 16:09:03 -0500 In-Reply-To: <200911191655.nAJGtYko021413@godzilla.ics.uci.edu> (Dan Nicolaescu's message of "Thu, 19 Nov 2009 08:55:34 -0800 (PST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3410=0 > Stefan, any reason not to check this in? Try it, Stefan From unknown Sat Sep 06 09:45:55 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: Dan Nicolaescu Subject: bug#4434 closed by Dan Nicolaescu (Re: bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported) Message-ID: References: <200911201630.nAKGUpEI024572@godzilla.ics.uci.edu> <200909141916.n8EJGGJJ023826@godzilla.ics.uci.edu> X-Emacs-PR-Message: they-closed 4434 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: patch Reply-To: 4434@debbugs.gnu.org Date: Fri, 20 Nov 2009 16:35:09 +0000 Content-Type: multipart/mixed; boundary="----------=_1258734909-27433-1" This is a multi-part message in MIME format... ------------=_1258734909-27433-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #4434: add -Wdeclaration-after-statement to CFLAGS if supported It has been closed by Dan Nicolaescu . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Dan Nicolaescu by replying to this email. --=20 4434: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D4434 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1258734909-27433-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 4434-done) by emacsbugs.donarmstrong.com; 20 Nov 2009 16:31:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-6.3 required=4.0 tests=AWL,HAS_BUG_NUMBER, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 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 nAKGV4pl027270 for <4434-done@emacsbugs.donarmstrong.com>; Fri, 20 Nov 2009 08:31:05 -0800 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 nAKGUpeB025878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 Nov 2009 08:30:51 -0800 Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id nAKGUpEI024572; Fri, 20 Nov 2009 08:30:51 -0800 (PST) Date: Fri, 20 Nov 2009 08:30:51 -0800 (PST) Message-Id: <200911201630.nAKGUpEI024572@godzilla.ics.uci.edu> From: Dan Nicolaescu To: Stefan Monnier Cc: 4434-done@debbugs.gnu.org Subject: Re: bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported References: <200909141916.n8EJGGJJ023826@godzilla.ics.uci.edu> <200911191655.nAJGtYko021413@godzilla.ics.uci.edu> X-Debbugs-No-Ack: yes In-Reply-To: (Stefan Monnier's message of "Thu, 19 Nov 2009 16:09:03 -0500") Lines: 7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: nAKGUpeB025878 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu Stefan Monnier writes: > > Stefan, any reason not to check this in? > > Try it, Done. Thanks. ------------=_1258734909-27433-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 14 Sep 2009 19:18:26 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.6 required=4.0 tests=AWL,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8EJIOEL027862 for ; Mon, 14 Sep 2009 12:18:25 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MnH4C-0004yL-0r for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 15:18:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MnH47-0004t9-Qz for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 15:18:23 -0400 Received: from [199.232.76.173] (port=34886 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnH47-0004sm-03 for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 15:18:19 -0400 Received: from barrelv2.ics.uci.edu ([128.195.1.114]:46775) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1MnH42-0003Hm-Ro for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 15:18:15 -0400 Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by barrelv2.ics.uci.edu (8.13.8+Sun/8.13.8) with ESMTP id n8EJGGwD005684 for ; Mon, 14 Sep 2009 12:16:16 -0700 (PDT) Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n8EJGGJJ023826; Mon, 14 Sep 2009 12:16:16 -0700 (PDT) Date: Mon, 14 Sep 2009 12:16:16 -0700 (PDT) Message-Id: <200909141916.n8EJGGJJ023826@godzilla.ics.uci.edu> From: Dan Nicolaescu To: bug-gnu-emacs Subject: add -Wdeclaration-after-statement to CFLAGS if supported Lines: 40 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: n8EJGGwD005684 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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 ------------=_1258734909-27433-1-- From unknown Sat Sep 06 09:45:55 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: Dan Nicolaescu Subject: bug#4261 closed by Dan Nicolaescu (Re: bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported) Message-ID: References: <200911201630.nAKGUpEI024572@godzilla.ics.uci.edu> <200908252316.n7PNGdd6014912@godzilla.ics.uci.edu> X-Emacs-PR-Message: they-closed 4261 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: patch Reply-To: 4261@debbugs.gnu.org Date: Fri, 20 Nov 2009 16:35:09 +0000 Content-Type: multipart/mixed; boundary="----------=_1258734909-27433-3" This is a multi-part message in MIME format... ------------=_1258734909-27433-3 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #4434: make gcc warn about c99 declarations It has been closed by Dan Nicolaescu . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Dan Nicolaescu by replying to this email. --=20 4434: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D4434 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1258734909-27433-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 4434-done) by emacsbugs.donarmstrong.com; 20 Nov 2009 16:31:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-6.3 required=4.0 tests=AWL,HAS_BUG_NUMBER, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 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 nAKGV4pl027270 for <4434-done@emacsbugs.donarmstrong.com>; Fri, 20 Nov 2009 08:31:05 -0800 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 nAKGUpeB025878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 Nov 2009 08:30:51 -0800 Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id nAKGUpEI024572; Fri, 20 Nov 2009 08:30:51 -0800 (PST) Date: Fri, 20 Nov 2009 08:30:51 -0800 (PST) Message-Id: <200911201630.nAKGUpEI024572@godzilla.ics.uci.edu> From: Dan Nicolaescu To: Stefan Monnier Cc: 4434-done@debbugs.gnu.org Subject: Re: bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported References: <200909141916.n8EJGGJJ023826@godzilla.ics.uci.edu> <200911191655.nAJGtYko021413@godzilla.ics.uci.edu> X-Debbugs-No-Ack: yes In-Reply-To: (Stefan Monnier's message of "Thu, 19 Nov 2009 16:09:03 -0500") Lines: 7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: nAKGUpeB025878 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu Stefan Monnier writes: > > Stefan, any reason not to check this in? > > Try it, Done. Thanks. ------------=_1258734909-27433-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 25 Aug 2009 23:18:25 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-5.2 required=4.0 tests=AWL,MURPHY_DRUGS_REL8, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7PNINCc026356 for ; Tue, 25 Aug 2009 16:18:24 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mg5HS-0001NM-Ur for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2009 19:18:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mg5HO-0001Cp-6Q for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2009 19:18:22 -0400 Received: from [199.232.76.173] (port=42544 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mg5HN-0001CU-VB for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2009 19:18:17 -0400 Received: from sallyv2.ics.uci.edu ([128.195.1.120]:61863) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1Mg5HN-0004fI-F9 for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2009 19:18:17 -0400 Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by sallyv2.ics.uci.edu (8.13.8+Sun/8.13.8) with ESMTP id n7PNGd9d001960 for ; Tue, 25 Aug 2009 16:16:39 -0700 (PDT) Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n7PNGdd6014912; Tue, 25 Aug 2009 16:16:39 -0700 (PDT) Date: Tue, 25 Aug 2009 16:16:39 -0700 (PDT) Message-Id: <200908252316.n7PNGdd6014912@godzilla.ics.uci.edu> From: Dan Nicolaescu To: bug-gnu-emacs Subject: make gcc warn about c99 declarations X-Debbugs-No-Ack: yes Lines: 38 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: n7PNGd9d001960 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) There were several patch proposals recently that had c99 style declarations in the middle of a block. There's a gcc flag that warns about that. The configure.in patch below enables the flag if gcc supports it, following the model for -Wno-pointer-sign Please apply if appropriate. 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 25 Aug 2009 23:11:58 -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 ------------=_1258734909-27433-3--