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: Mon, 14 Sep 2009 12:16:16 -0700 (PDT) Message-ID: <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 1252956451 19218 80.91.229.12 (14 Sep 2009 19:27:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Sep 2009 19:27:31 +0000 (UTC) To: bug-gnu-emacs Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 14 21:27:24 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 1MnHCt-000771-U5 for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Sep 2009 21:27:24 +0200 Original-Received: from localhost ([127.0.0.1]:46261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnHCt-0004hh-A3 for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Sep 2009 15:27:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MnHCe-0004cD-Tf for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 15:27:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MnHCZ-0004bS-DG for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 15:27:07 -0400 Original-Received: from [199.232.76.173] (port=41446 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnHCZ-0004bP-4M for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 15:27:03 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:55508) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MnHCY-0005TS-KD for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 15:27:02 -0400 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 n8EJR0eO029329; Mon, 14 Sep 2009 12:27:00 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8EJP8lE028974; Mon, 14 Sep 2009 12:25:08 -0700 Resent-Date: Mon, 14 Sep 2009 12:25:08 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Dan Nicolaescu Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Mon, 14 Sep 2009 19:25:07 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 4434 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125295590627865 (code B ref -1); Mon, 14 Sep 2009 19:25:07 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 14 Sep 2009 19:18:26 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-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 Original-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 Original-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 Original-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 Original-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 Original-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) Original-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) Original-Lines: 40 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) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Mon, 14 Sep 2009 15:27:07 -0400 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:31089 Archived-At: 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