diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-29 03:30:47 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-29 03:30:47 +0000 |
commit | 1d7525088416d1e29abc78ed78cf09ed2cb13782 (patch) | |
tree | d4a553c734fb691a872f7a7a3de2bf60d8a30c00 /gcc/configure | |
parent | 6614ba2d0669c07cf4ca63d81a8201d235e38bee (diff) | |
download | gcc-1d7525088416d1e29abc78ed78cf09ed2cb13782.tar.gz |
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.
==================================================================
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110360 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/configure')
-rwxr-xr-x | gcc/configure | 58 |
1 files changed, 55 insertions, 3 deletions
diff --git a/gcc/configure b/gcc/configure index 7f357994d4f..14ee2ba54f6 100755 --- a/gcc/configure +++ b/gcc/configure @@ -6000,6 +6000,7 @@ fi # 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. echo "$as_me:$LINENO: checking whether ${CC} accepts -Wno-long-long" >&5 @@ -6102,10 +6103,61 @@ fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_no_variadic_macros" >&5 echo "${ECHO_T}$ac_cv_prog_cc_w_no_variadic_macros" >&6 +echo "$as_me:$LINENO: checking whether ${CC} accepts -Wno-overlength-strings" >&5 +echo $ECHO_N "checking whether ${CC} accepts -Wno-overlength-strings... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_w_no_overlength_strings+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + save_CFLAGS="$CFLAGS" + CFLAGS="-Wno-overlength-strings" + 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_no_overlength_strings=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_w_no_overlength_strings=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_no_overlength_strings" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_w_no_overlength_strings" >&6 + 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 @@ -7468,7 +7520,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:7471: version of makeinfo is $ac_prog_version" >&5 + echo "configure:7523: version of makeinfo is $ac_prog_version" >&5 case $ac_prog_version in '') gcc_cv_prog_makeinfo_modern=no;; 4.[4-9]*) |