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/genconditions.c | |
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/genconditions.c')
-rw-r--r-- | gcc/genconditions.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/gcc/genconditions.c b/gcc/genconditions.c index bc4bfd57151..ae9a67e305c 100644 --- a/gcc/genconditions.c +++ b/gcc/genconditions.c @@ -52,9 +52,8 @@ write_header (void) machine description file. */\n\ \n\ #include \"bconfig.h\"\n\ -#include \"system.h\"\n"); - - puts ("\ +#include \"system.h\"\n\ +\n\ /* It is necessary, but not entirely safe, to include the headers below\n\ in a generator program. As a defensive measure, don't do so when the\n\ table isn't going to have anything in it. */\n\ @@ -66,23 +65,20 @@ write_header (void) #undef ENABLE_RTL_CHECKING\n\ #undef ENABLE_RTL_FLAG_CHECKING\n\ #undef ENABLE_GC_CHECKING\n\ -#undef ENABLE_GC_ALWAYS_COLLECT\n"); - - puts ("\ +#undef ENABLE_GC_ALWAYS_COLLECT\n\ +\n\ #include \"coretypes.h\"\n\ #include \"tm.h\"\n\ #include \"insn-constants.h\"\n\ #include \"rtl.h\"\n\ #include \"tm_p.h\"\n\ -#include \"function.h\"\n"); - - puts ("\ +#include \"function.h\"\n\ +\n\ /* Fake - insn-config.h doesn't exist yet. */\n\ #define MAX_RECOG_OPERANDS 10\n\ #define MAX_DUP_OPERANDS 10\n\ -#define MAX_INSNS_PER_SPLIT 5\n"); - - puts ("\ +#define MAX_INSNS_PER_SPLIT 5\n\ +\n\ #include \"regs.h\"\n\ #include \"recog.h\"\n\ #include \"real.h\"\n\ @@ -134,11 +130,11 @@ write_one_condition (void **slot, void * ARG_UNUSED (dummy)) putchar (*p); } - printf ("\",\n __builtin_constant_p "); + fputs ("\",\n __builtin_constant_p ", stdout); print_c_condition (test->expr); - printf ("\n ? (int) "); + fputs ("\n ? (int) ", stdout); print_c_condition (test->expr); - printf ("\n : -1 },\n"); + fputs ("\n : -1 },\n", stdout); return 1; } @@ -154,9 +150,8 @@ struct c_test\n\ {\n\ const char *expr;\n\ int value;\n\ -};\n"); - - puts ("\ +};\n\ +\n\ /* This table lists each condition found in the machine description.\n\ Each condition is mapped to its truth value (0 or 1), or -1 if that\n\ cannot be calculated at compile time.\n\ @@ -200,8 +195,8 @@ write_writer (void) " putchar (*p);\n" " }\n" " puts (\"\\\")\");\n" - " }"); - puts (" puts (\"])\");\n" + " }\n" + " puts (\"])\");\n" " fflush (stdout);\n" "return ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE;\n" "}"); |