Makefile.in (STRICT2_WARN): Add -Wmissing-format-attribute.
* Makefile.in (STRICT2_WARN): Add -Wmissing-format-attribute. * configure.ac: Check for -Wmissing-format-attribute. * configure: Regenerate. From-SVN: r102326
This commit is contained in:
parent
4cf507fc16
commit
ac0f3f3949
4 changed files with 83 additions and 4 deletions
|
@ -1,3 +1,10 @@
|
|||
2005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* Makefile.in (STRICT2_WARN): Add -Wmissing-format-attribute.
|
||||
* configure.ac: Check for -Wmissing-format-attribute.
|
||||
|
||||
* configure: Regenerate.
|
||||
|
||||
2005-07-23 Richard Henderson <rth@redhat.com>
|
||||
|
||||
PR tree-optimization/22623
|
||||
|
|
|
@ -176,7 +176,7 @@ LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
|
|||
STRICT_WARN = @strict1_warn@
|
||||
WERROR_FLAGS = @WERROR@
|
||||
STRICT2_WARN = -pedantic -Wno-long-long -Wno-variadic-macros \
|
||||
-Wold-style-definition $(WERROR_FLAGS)
|
||||
-Wold-style-definition -Wmissing-format-attribute $(WERROR_FLAGS)
|
||||
|
||||
# This is set by --enable-checking. The idea is to catch forgotten
|
||||
# "extern" tags in header files.
|
||||
|
|
60
gcc/configure
vendored
60
gcc/configure
vendored
|
@ -6164,7 +6164,6 @@ if test $ac_cv_prog_cc_w_no_long_long = yes \
|
|||
strict1_warn="-pedantic -Wno-long-long -Wno-variadic-macros"
|
||||
fi
|
||||
|
||||
|
||||
# Add -Wold-style-definition if it's accepted
|
||||
echo "$as_me:$LINENO: checking whether ${CC} accepts -Wold-style-definition" >&5
|
||||
echo $ECHO_N "checking whether ${CC} accepts -Wold-style-definition... $ECHO_C" >&6
|
||||
|
@ -6220,6 +6219,61 @@ if test $ac_cv_prog_cc_w_old_style_definition = yes ; then
|
|||
strict1_warn="${strict1_warn} -Wold-style-definition"
|
||||
fi
|
||||
|
||||
# Add -Wmissing-format-attribute if it's accepted
|
||||
echo "$as_me:$LINENO: checking whether ${CC} accepts -Wmissing-format-attribute" >&5
|
||||
echo $ECHO_N "checking whether ${CC} accepts -Wmissing-format-attribute... $ECHO_C" >&6
|
||||
if test "${ac_cv_prog_cc_w_missing_format_attribute+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="-Wmissing-format-attribute"
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
(eval $ac_compile) 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_c_werror_flag"
|
||||
|| test ! -s conftest.err'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; } &&
|
||||
{ ac_try='test -s conftest.$ac_objext'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
ac_cv_prog_cc_w_missing_format_attribute=yes
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_cv_prog_cc_w_missing_format_attribute=no
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_missing_format_attribute" >&5
|
||||
echo "${ECHO_T}$ac_cv_prog_cc_w_missing_format_attribute" >&6
|
||||
if test $ac_cv_prog_cc_w_missing_format_attribute = yes ; then
|
||||
strict1_warn="${strict1_warn} -Wmissing-format-attribute"
|
||||
fi
|
||||
|
||||
# Enable -Werror, period.
|
||||
# Check whether --enable-werror_always or --disable-werror_always was given.
|
||||
if test "${enable_werror_always+set}" = set; then
|
||||
|
@ -6233,6 +6287,8 @@ if test x${enable_werror_always} = xyes ; then
|
|||
WERROR=-Werror
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# If the native compiler is GCC, we can enable warnings even in stage1.
|
||||
# That's useful for people building cross-compilers, or just running a
|
||||
# quick `make'.
|
||||
|
@ -7408,7 +7464,7 @@ if test "${gcc_cv_prog_makeinfo_modern+set}" = set; then
|
|||
else
|
||||
ac_prog_version=`$MAKEINFO --version 2>&1 |
|
||||
sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
|
||||
echo "configure:7411: version of makeinfo is $ac_prog_version" >&5
|
||||
echo "configure:7467: version of makeinfo is $ac_prog_version" >&5
|
||||
case $ac_prog_version in
|
||||
'') gcc_cv_prog_makeinfo_modern=no;;
|
||||
4.[2-9]*)
|
||||
|
|
|
@ -330,7 +330,6 @@ if test $ac_cv_prog_cc_w_no_long_long = yes \
|
|||
&& test $ac_cv_prog_cc_w_no_variadic_macros = yes ; then
|
||||
strict1_warn="-pedantic -Wno-long-long -Wno-variadic-macros"
|
||||
fi
|
||||
AC_SUBST(strict1_warn)
|
||||
|
||||
# Add -Wold-style-definition if it's accepted
|
||||
AC_CACHE_CHECK(
|
||||
|
@ -347,6 +346,21 @@ if test $ac_cv_prog_cc_w_old_style_definition = yes ; then
|
|||
strict1_warn="${strict1_warn} -Wold-style-definition"
|
||||
fi
|
||||
|
||||
# Add -Wmissing-format-attribute if it's accepted
|
||||
AC_CACHE_CHECK(
|
||||
[whether ${CC} accepts -Wmissing-format-attribute],
|
||||
[ac_cv_prog_cc_w_missing_format_attribute],
|
||||
[save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="-Wmissing-format-attribute"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
|
||||
[ac_cv_prog_cc_w_missing_format_attribute=yes],
|
||||
[ac_cv_prog_cc_w_missing_format_attribute=no])
|
||||
CFLAGS="$save_CFLAGS"
|
||||
])
|
||||
if test $ac_cv_prog_cc_w_missing_format_attribute = yes ; then
|
||||
strict1_warn="${strict1_warn} -Wmissing-format-attribute"
|
||||
fi
|
||||
|
||||
# Enable -Werror, period.
|
||||
AC_ARG_ENABLE(werror_always,
|
||||
[ --enable-werror-always enable -Werror always], [],
|
||||
|
@ -356,6 +370,8 @@ if test x${enable_werror_always} = xyes ; then
|
|||
WERROR=-Werror
|
||||
fi
|
||||
|
||||
AC_SUBST(strict1_warn)
|
||||
|
||||
# If the native compiler is GCC, we can enable warnings even in stage1.
|
||||
# That's useful for people building cross-compilers, or just running a
|
||||
# quick `make'.
|
||||
|
|
Loading…
Add table
Reference in a new issue