diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2006-01-29 03:30:47 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2006-01-29 03:30:47 +0000 |
commit | 89a42ac8a1c85ee240df92c7ccd0c973bc95a24c (patch) | |
tree | d4a553c734fb691a872f7a7a3de2bf60d8a30c00 /gcc/configure.ac | |
parent | 0f7868fed2674fab28566ce47b388c5a48a9c8aa (diff) | |
download | gcc-89a42ac8a1c85ee240df92c7ccd0c973bc95a24c.zip gcc-89a42ac8a1c85ee240df92c7ccd0c973bc95a24c.tar.gz gcc-89a42ac8a1c85ee240df92c7ccd0c973bc95a24c.tar.bz2 |
c.opt: Add -W(no-)overlength-strings.
gcc:
* c.opt: Add -W(no-)overlength-strings.
* doc/invoke.texi: Document it.
* c-opts.c (c_common_handle_option): -pedantic implies
-Woverlength-strings, if not explicitly disabled already.
(c_common_post_options): -Woverlength-strings defaults to off, and
is always off for C++.
* c-common.c (fix_string_type): Issue warning about strings longer
than is portable only if warn_overlength_strings. Rearrange code
a little for clarity.
* configure.in: Check for -Wno-overlength-strings as well before
enabling -pedantic in stage 1.
* Makefile.in (STRICT2_WARN): Add -Wno-overlength-strings.
(gcc.o-warn, insn-automata.o-warn, build/gencondmd.o-warn): Delete.
* genconditions.c (write_header, write_one_condition)
(write_conditions, write_writer): Consolidate very long strings
that were broken up to fit in C89 portable limit. Don't use
printf when fputs will do.
gcc/testsuite:
* gcc.dg/Woverlength-strings.c
* gcc.dg/Woverlength-strings-pedantic-c89.c
* gcc.dg/Woverlength-strings-pedantic-c89-no.c
* gcc.dg/Woverlength-strings-pedantic-c99.c
* gcc.dg/Woverlength-strings-pedantic-c99-no.c: New tests.
==================================================================
From-SVN: r110360
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r-- | gcc/configure.ac | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac index 03964d6..dd3823f 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -301,6 +301,7 @@ AC_CHECK_TYPES([__int64], [AC_CHECK_SIZEOF(__int64)]) # We want to use -pedantic, but we don't want warnings about # * 'long long' # * variadic macros +# * overlong strings # So, we only use -pedantic if we can disable those warnings. AC_CACHE_CHECK( @@ -325,10 +326,22 @@ AC_CACHE_CHECK( CFLAGS="$save_CFLAGS" ]) +AC_CACHE_CHECK( + [whether ${CC} accepts -Wno-overlength-strings], + [ac_cv_prog_cc_w_no_overlength_strings], + [save_CFLAGS="$CFLAGS" + CFLAGS="-Wno-overlength-strings" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], + [ac_cv_prog_cc_w_no_overlength_strings=yes], + [ac_cv_prog_cc_w_no_overlength_strings=no]) + CFLAGS="$save_CFLAGS" + ]) + strict1_warn= 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" + && test $ac_cv_prog_cc_w_no_variadic_macros = yes \ + && test $ac_cv_prog_cc_w_no_overlength_strings = yes ; then + strict1_warn="-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings" fi # Add -Wold-style-definition if it's accepted |