Re: [patch] PR51388

2011-12-12 Thread Richard Guenther
On Sun, Dec 11, 2011 at 6:03 PM, Steven Bosscher  wrote:
> Hello,
>
> The configure scripts check for -Wno-narrowing, but GCC ignores rather
> than rejects unknown -Wno-* warnings.
>
> Fixed by checking for the positive warning, -Wnarrowing.
>
> OK for trunk?

But that will now pass -Wnarrowing instead of -Wno-narrowing to
the build.  So I think the fix should be done to
ACX_PROG_CC_WARNING_OPTS which should strip 'no-' from
the option before checking it (well, possibly testing both the -W
and the -Wno- variant) and append the -Wno- variant.

Richard.

> Ciao!
> Steven


[patch] PR51388

2011-12-11 Thread Steven Bosscher
Hello,

The configure scripts check for -Wno-narrowing, but GCC ignores rather
than rejects unknown -Wno-* warnings.

Fixed by checking for the positive warning, -Wnarrowing.

OK for trunk?

Ciao!
Steven
gcc/
PR bootstrap/51388
configure.ac: Check for Wnarrowing instead of Wno-narrowing.
configure: Regenerate.

libcpp/
PR bootstrap/51388
configure.ac: Check for Wnarrowing instead of Wno-narrowing.
configure: Regenerate.

Index: gcc/configure
===
--- gcc/configure   (revision 182207)
+++ gcc/configure   (working copy)
@@ -6400,7 +6400,7 @@ fi
 
 loose_warn=
 save_CFLAGS="$CFLAGS"
-for option in -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual; do
+for option in -W -Wall -Wnarrowing -Wwrite-strings -Wcast-qual; do
   as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports 
$option" >&5
Index: gcc/configure.ac
===
--- gcc/configure.ac(revision 182207)
+++ gcc/configure.ac(working copy)
@@ -333,7 +333,7 @@ GCC_STDINT_TYPES
 # So, we only use -pedantic if we can disable those warnings.
 
 ACX_PROG_CC_WARNING_OPTS(
-   m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual])), 
[loose_warn])
+   m4_quote(m4_do([-W -Wall -Wnarrowing -Wwrite-strings -Wcast-qual])), 
[loose_warn])
 ACX_PROG_CC_WARNING_OPTS(
m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes])),
[c_loose_warn])
Index: libcpp/configure
===
--- libcpp/configure(revision 182207)
+++ libcpp/configure(working copy)
@@ -4688,7 +4688,7 @@ test -n "$AUTOHEADER" || AUTOHEADER="$MI
 
 warn=
 save_CFLAGS="$CFLAGS"
-for option in -W -Wall -Wno-narrowing -Wwrite-strings \
+for option in -W -Wall -Wnarrowing -Wwrite-strings \
  -Wmissing-format-attribute; do
   as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
 
Index: libcpp/configure.ac
===
--- libcpp/configure.ac (revision 182207)
+++ libcpp/configure.ac (working copy)
@@ -33,7 +33,7 @@ AC_CHECK_PROGS([AUTOHEADER], [autoheader
 # Figure out what compiler warnings we can enable.
 # See config/warnings.m4 for details.
 
-ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wno-narrowing -Wwrite-strings \
+ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wnarrowing -Wwrite-strings \
  -Wmissing-format-attribute], [warn])
 ACX_PROG_CC_WARNING_OPTS([-Wstrict-prototypes -Wmissing-prototypes \
  -Wold-style-definition -Wc++-compat], [c_warn])