Skip to content

Commit a53e62c

Browse files
Check for warning flags without no- prefix
config/: * warnings.m4 (ACX_PROG_CC_WARNING_OPTS) (ACX_PROG_CC_WARNING_ALMOST_PEDANTIC): Run the test without the no- prefix. libdecnumber/: * configure: Regenerate. libiberty/: * configure: Regenerate.
1 parent 049682b commit a53e62c

File tree

6 files changed

+60
-20
lines changed

6 files changed

+60
-20
lines changed

config/ChangeLog

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2011-12-19 Andreas Schwab <[email protected]>
2+
3+
* warnings.m4 (ACX_PROG_CC_WARNING_OPTS)
4+
(ACX_PROG_CC_WARNING_ALMOST_PEDANTIC): Run the test without the
5+
no- prefix.
6+
17
2011-12-18 Eric Botcazou <[email protected]>
28

39
* acx.m4 (Test for GNAT): Update comment and add quotes in final test.

config/warnings.m4

+17-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Autoconf include file defining macros related to compile-time warnings.
22

3-
# Copyright 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
3+
# Copyright 2004, 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
44

55
#This file is part of GCC.
66

@@ -28,7 +28,13 @@ AC_SUBST(acx_Var)dnl
2828
m4_expand_once([acx_Var=
2929
],m4_quote(acx_Var=))dnl
3030
save_CFLAGS="$CFLAGS"
31-
for option in $1; do
31+
for real_option in $1; do
32+
# Do the check with the no- prefix removed since gcc silently
33+
# accepts any -Wno-* option on purpose
34+
case $real_option in
35+
-Wno-*) option=-W`expr $real_option : '-Wno-\(.*\)'` ;;
36+
*) option=$real_option ;;
37+
esac
3238
AS_VAR_PUSHDEF([acx_Woption], [acx_cv_prog_cc_warning_$option])
3339
AC_CACHE_CHECK([whether $CC supports $option], acx_Woption,
3440
[CFLAGS="$option"
@@ -37,14 +43,14 @@ for option in $1; do
3743
[AS_VAR_SET(acx_Woption, no)])
3844
])
3945
AS_IF([test AS_VAR_GET(acx_Woption) = yes],
40-
[acx_Var="$acx_Var${acx_Var:+ }$option"])
46+
[acx_Var="$acx_Var${acx_Var:+ }$real_option"])
4147
AS_VAR_POPDEF([acx_Woption])dnl
4248
done
4349
CFLAGS="$save_CFLAGS"
4450
m4_popdef([acx_Var])dnl
4551
])# ACX_PROG_CC_WARNING_OPTS
4652

47-
# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC(WARNINGS, [VARIABLE = WARN_PEDANTIC)
53+
# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC(WARNINGS, [VARIABLE = WARN_PEDANTIC])
4854
# Append to VARIABLE "-pedantic" + the argument, if the compiler is GCC
4955
# and accepts all of those options simultaneously, otherwise to nothing.
5056
AC_DEFUN([ACX_PROG_CC_WARNING_ALMOST_PEDANTIC],
@@ -53,11 +59,14 @@ m4_pushdef([acx_Var], [m4_default([$2], [WARN_PEDANTIC])])dnl
5359
AC_SUBST(acx_Var)dnl
5460
m4_expand_once([acx_Var=
5561
],m4_quote(acx_Var=))dnl
56-
AS_VAR_PUSHDEF([acx_Pedantic], [acx_cv_prog_cc_pedantic_$1])dnl
62+
# Do the check with the no- prefix removed from the warning options
63+
# since gcc silently accepts any -Wno-* option on purpose
64+
m4_pushdef([acx_Woptions], [m4_bpatsubst([$1], [-Wno-], [-W])])dnl
65+
AS_VAR_PUSHDEF([acx_Pedantic], [acx_cv_prog_cc_pedantic_]acx_Woptions)dnl
5766
AS_IF([test "$GCC" = yes],
58-
[AC_CACHE_CHECK([whether $CC supports -pedantic $1], acx_Pedantic,
67+
[AC_CACHE_CHECK([whether $CC supports -pedantic ]acx_Woptions, acx_Pedantic,
5968
[save_CFLAGS="$CFLAGS"
60-
CFLAGS="-pedantic $1"
69+
CFLAGS="-pedantic acx_Woptions"
6170
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
6271
[AS_VAR_SET(acx_Pedantic, yes)],
6372
[AS_VAR_SET(acx_Pedantic, no)])
@@ -66,6 +75,7 @@ AS_IF([test AS_VAR_GET(acx_Pedantic) = yes],
6675
[acx_Var="$acx_Var${acx_Var:+ }-pedantic $1"])
6776
])
6877
AS_VAR_POPDEF([acx_Pedantic])dnl
78+
m4_popdef([acx_Woptions])dnl
6979
m4_popdef([acx_Var])dnl
7080
])# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC
7181

libdecnumber/ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2011-12-19 Andreas Schwab <[email protected]>
2+
3+
* configure: Regenerate.
4+
15
2011-04-20 Jim Meyering <[email protected]>
26

37
* decNumber.c (decNumberFromString): Remove useless

libdecnumber/configure

+19-11
Original file line numberDiff line numberDiff line change
@@ -3248,9 +3248,15 @@ test -n "$AUTOHEADER" || AUTOHEADER="$MISSING autoheader"
32483248
32493249
WARN_CFLAGS=
32503250
save_CFLAGS="$CFLAGS"
3251-
for option in -W -Wall -Wwrite-strings -Wstrict-prototypes \
3251+
for real_option in -W -Wall -Wwrite-strings -Wstrict-prototypes \
32523252
-Wmissing-prototypes -Wold-style-definition \
32533253
-Wmissing-format-attribute -Wcast-qual; do
3254+
# Do the check with the no- prefix removed since gcc silently
3255+
# accepts any -Wno-* option on purpose
3256+
case $real_option in
3257+
-Wno-*) option=-W`expr $real_option : '-Wno-\(.*\)'` ;;
3258+
*) option=$real_option ;;
3259+
esac
32543260
as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
32553261
32563262
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5
@@ -3282,20 +3288,22 @@ eval ac_res=\$$as_acx_Woption
32823288
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
32833289
$as_echo "$ac_res" >&6; }
32843290
if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then :
3285-
WARN_CFLAGS="$WARN_CFLAGS${WARN_CFLAGS:+ }$option"
3291+
WARN_CFLAGS="$WARN_CFLAGS${WARN_CFLAGS:+ }$real_option"
32863292
fi
32873293
done
32883294
CFLAGS="$save_CFLAGS"
32893295
32903296
WARN_PEDANTIC=
3297+
# Do the check with the no- prefix removed from the warning options
3298+
# since gcc silently accepts any -Wno-* option on purpose
32913299
if test "$GCC" = yes; then :
3292-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -pedantic -Wno-long-long" >&5
3293-
$as_echo_n "checking whether $CC supports -pedantic -Wno-long-long... " >&6; }
3294-
if test "${acx_cv_prog_cc_pedantic__Wno_long_long+set}" = set; then :
3300+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -pedantic -Wlong-long" >&5
3301+
$as_echo_n "checking whether $CC supports -pedantic -Wlong-long... " >&6; }
3302+
if test "${acx_cv_prog_cc_pedantic__Wlong_long+set}" = set; then :
32953303
$as_echo_n "(cached) " >&6
32963304
else
32973305
save_CFLAGS="$CFLAGS"
3298-
CFLAGS="-pedantic -Wno-long-long"
3306+
CFLAGS="-pedantic -Wlong-long"
32993307
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33003308
/* end confdefs.h. */
33013309
@@ -3308,16 +3316,16 @@ main ()
33083316
}
33093317
_ACEOF
33103318
if ac_fn_c_try_compile "$LINENO"; then :
3311-
acx_cv_prog_cc_pedantic__Wno_long_long=yes
3319+
acx_cv_prog_cc_pedantic__Wlong_long=yes
33123320
else
3313-
acx_cv_prog_cc_pedantic__Wno_long_long=no
3321+
acx_cv_prog_cc_pedantic__Wlong_long=no
33143322
fi
33153323
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
33163324
CFLAGS="$save_CFLAGS"
33173325
fi
3318-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_prog_cc_pedantic__Wno_long_long" >&5
3319-
$as_echo "$acx_cv_prog_cc_pedantic__Wno_long_long" >&6; }
3320-
if test $acx_cv_prog_cc_pedantic__Wno_long_long = yes; then :
3326+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_prog_cc_pedantic__Wlong_long" >&5
3327+
$as_echo "$acx_cv_prog_cc_pedantic__Wlong_long" >&6; }
3328+
if test $acx_cv_prog_cc_pedantic__Wlong_long = yes; then :
33213329
WARN_PEDANTIC="$WARN_PEDANTIC${WARN_PEDANTIC:+ }-pedantic -Wno-long-long"
33223330
fi
33233331

libiberty/ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2011-12-19 Andreas Schwab <[email protected]>
2+
3+
* configure: Regenerate.
4+
15
2011-11-07 Richard Henderson <[email protected]>
26

37
Merged from transactional-memory.

libiberty/configure

+10-2
Original file line numberDiff line numberDiff line change
@@ -3920,8 +3920,14 @@ ac_c_preproc_warn_flag=yes
39203920
39213921
ac_libiberty_warn_cflags=
39223922
save_CFLAGS="$CFLAGS"
3923-
for option in -W -Wall -Wwrite-strings -Wc++-compat \
3923+
for real_option in -W -Wall -Wwrite-strings -Wc++-compat \
39243924
-Wstrict-prototypes; do
3925+
# Do the check with the no- prefix removed since gcc silently
3926+
# accepts any -Wno-* option on purpose
3927+
case $real_option in
3928+
-Wno-*) option=-W`expr $real_option : '-Wno-\(.*\)'` ;;
3929+
*) option=$real_option ;;
3930+
esac
39253931
as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
39263932
39273933
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5
@@ -3953,11 +3959,13 @@ eval ac_res=\$$as_acx_Woption
39533959
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
39543960
$as_echo "$ac_res" >&6; }
39553961
if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then :
3956-
ac_libiberty_warn_cflags="$ac_libiberty_warn_cflags${ac_libiberty_warn_cflags:+ }$option"
3962+
ac_libiberty_warn_cflags="$ac_libiberty_warn_cflags${ac_libiberty_warn_cflags:+ }$real_option"
39573963
fi
39583964
done
39593965
CFLAGS="$save_CFLAGS"
39603966
3967+
# Do the check with the no- prefix removed from the warning options
3968+
# since gcc silently accepts any -Wno-* option on purpose
39613969
if test "$GCC" = yes; then :
39623970
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -pedantic " >&5
39633971
$as_echo_n "checking whether $CC supports -pedantic ... " >&6; }

0 commit comments

Comments
 (0)