unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4261: make gcc warn about c99 declarations
@ 2009-08-25 23:16 ` Dan Nicolaescu
  2009-11-20 16:35   ` bug#4261: marked as done (make gcc warn about c99 declarations) Emacs bug Tracking System
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Nicolaescu @ 2009-08-25 23:16 UTC (permalink / raw)
  To: bug-gnu-emacs

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






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported
@ 2009-09-14 19:16 ` Dan Nicolaescu
  2009-11-19 16:55   ` Dan Nicolaescu
  2009-11-20 16:35   ` bug#4434: marked as done (add -Wdeclaration-after-statement to CFLAGS if supported) Emacs bug Tracking System
  0 siblings, 2 replies; 6+ messages in thread
From: Dan Nicolaescu @ 2009-09-14 19:16 UTC (permalink / raw)
  To: bug-gnu-emacs

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






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported
  2009-09-14 19:16 ` bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported Dan Nicolaescu
@ 2009-11-19 16:55   ` 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
  1 sibling, 1 reply; 6+ messages in thread
From: Dan Nicolaescu @ 2009-11-19 16:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 4434

Dan Nicolaescu <dann@ics.uci.edu> 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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported
  2009-11-19 16:55   ` Dan Nicolaescu
@ 2009-11-19 21:09     ` Stefan Monnier
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2009-11-19 21:09 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: 4434

> Stefan, any reason not to check this in?

Try it,


        Stefan





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#4434: marked as done (add -Wdeclaration-after-statement to CFLAGS if supported)
  2009-09-14 19:16 ` bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported Dan Nicolaescu
  2009-11-19 16:55   ` Dan Nicolaescu
@ 2009-11-20 16:35   ` Emacs bug Tracking System
  1 sibling, 0 replies; 6+ messages in thread
From: Emacs bug Tracking System @ 2009-11-20 16:35 UTC (permalink / raw)
  To: Dan Nicolaescu

[-- Attachment #1: Type: text/plain, Size: 934 bytes --]

Your message dated Fri, 20 Nov 2009 08:30:51 -0800 (PST)
with message-id <200911201630.nAKGUpEI024572@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 owner@emacsbugs.donarmstrong.com
immediately.)


-- 
4434: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4434
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 3643 bytes --]

From: Dan Nicolaescu <dann@ics.uci.edu>
To: bug-gnu-emacs <bug-gnu-emacs@gnu.org>
Subject: 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>

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



[-- Attachment #3: Type: message/rfc822, Size: 2259 bytes --]

From: Dan Nicolaescu <dann@ics.uci.edu>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: 4434-done@emacsbugs.donarmstrong.com
Subject: Re: bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported
Date: Fri, 20 Nov 2009 08:30:51 -0800 (PST)
Message-ID: <200911201630.nAKGUpEI024572@godzilla.ics.uci.edu>

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

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

Done. Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#4261: marked as done (make gcc warn about c99 declarations)
  2009-08-25 23:16 ` bug#4261: make gcc warn about c99 declarations Dan Nicolaescu
@ 2009-11-20 16:35   ` Emacs bug Tracking System
  0 siblings, 0 replies; 6+ messages in thread
From: Emacs bug Tracking System @ 2009-11-20 16:35 UTC (permalink / raw)
  To: Dan Nicolaescu

[-- Attachment #1: Type: text/plain, Size: 914 bytes --]

Your message dated Fri, 20 Nov 2009 08:30:51 -0800 (PST)
with message-id <200911201630.nAKGUpEI024572@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 make gcc warn about c99 declarations
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 owner@emacsbugs.donarmstrong.com
immediately.)


-- 
4434: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4434
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 3703 bytes --]

From: Dan Nicolaescu <dann@ics.uci.edu>
To: bug-gnu-emacs <bug-gnu-emacs@gnu.org>
Subject: make gcc warn about c99 declarations
Date: Tue, 25 Aug 2009 16:16:39 -0700 (PDT)
Message-ID: <200908252316.n7PNGdd6014912@godzilla.ics.uci.edu>

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



[-- Attachment #3: Type: message/rfc822, Size: 2259 bytes --]

From: Dan Nicolaescu <dann@ics.uci.edu>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: 4434-done@emacsbugs.donarmstrong.com
Subject: Re: bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported
Date: Fri, 20 Nov 2009 08:30:51 -0800 (PST)
Message-ID: <200911201630.nAKGUpEI024572@godzilla.ics.uci.edu>

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

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

Done. Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-11-20 16:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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 ` bug#4434: add -Wdeclaration-after-statement to CFLAGS if supported Dan Nicolaescu
2009-11-19 16:55   ` 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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).