bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: warning: module to simplify adding compiler warnings


From: Simon Josefsson
Subject: Re: warning: module to simplify adding compiler warnings
Date: Mon, 17 Nov 2008 21:37:21 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Paolo Bonzini <address@hidden> writes:

> Simon Josefsson wrote:
>> I want to add some warning flags from configure, including -Werror.
>
> You can use AC_PREPROC_IFELSE if using GCC:
>
> $ gcc -E -x c /dev/null -Wno-frobnicate
> cc1: error: unrecognized command line option "-Wno-frobnicate"
>
> It is faster.

Right, but CFLAGS needs to be CPPFLAGS then.  I've pushed this.

/Simon

>From d7b47e91d97f3575c3ab7849ef4b7bd830c17172 Mon Sep 17 00:00:00 2001
From: Simon Josefsson <address@hidden>
Date: Mon, 17 Nov 2008 21:35:50 +0100
Subject: [PATCH] warnings: Use CPPFLAGS to really check whether the parameter 
works.

---
 ChangeLog      |    5 +++++
 m4/warnings.m4 |    6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0d3139c..61cd8fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-11-17  Simon Josefsson  <address@hidden>
 
+       * m4/warnings.m4: Use CPPFLAGS to really check whether the
+       parameter works.
+
+2008-11-17  Simon Josefsson  <address@hidden>
+
        * m4/warnings.m4: Add gl_WARN_COMPLEMENT and gl_WARN_SUPPORTED.
 
 2008-11-17  Bruce Korb  <address@hidden>
diff --git a/m4/warnings.m4 b/m4/warnings.m4
index f836793..686d8c7 100644
--- a/m4/warnings.m4
+++ b/m4/warnings.m4
@@ -29,12 +29,12 @@ m4_ifdef([AS_VAR_APPEND],
 AC_DEFUN([gl_WARN_ADD],
 [AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_$1])dnl
 AC_CACHE_CHECK([whether compiler handles $1], [gl_Warn], [
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="${CFLAGS} $1"
+  save_CPPFLAGS="$CPPFLAGS"
+  CPPFLAGS="${CPPFLAGS} $1"
   AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])],
                     [AS_VAR_SET([gl_Warn], [yes])],
                    [AS_VAR_SET([gl_Warn], [no])])
-  CFLAGS="$save_CFLAGS"
+  CPPFLAGS="$save_CPPFLAGS"
 ])
 AS_VAR_PUSHDEF([gl_Flags], m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]))dnl
 gl_AS_VAR_IF([gl_Warn], [yes], [gl_AS_VAR_APPEND([gl_Flags], [" $1"])])
-- 
1.5.6.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]