diff options
author | Jakub Jelinek <jakub@redhat.com> | 2002-01-29 13:09:37 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2002-01-29 13:09:37 +0100 |
commit | ffdeea47b90c0c898219ac96df667012fe9fb739 (patch) | |
tree | 1cb6969668582a88e15febb0d2435a1ddd4ca215 /gcc/gcc.c | |
parent | b8b98c66af69365e645718d3bf72ccabaa6ef2ab (diff) | |
download | gcc-ffdeea47b90c0c898219ac96df667012fe9fb739.zip gcc-ffdeea47b90c0c898219ac96df667012fe9fb739.tar.gz gcc-ffdeea47b90c0c898219ac96df667012fe9fb739.tar.bz2 |
re PR other/1502 (Nonexistent -W options not diagnosed)
PR other/1502:
* cppinit.c (cpp_handle_option): Add ignore argument, if it is zero,
don't ignore unrecognized -W* options.
(cpp_handle_options): Pass 1 as last argument to cpp_handle_option.
* cpplib.h (cpp_handle_option): Adjust prototype.
* c-decl.c (c_decode_options): Pass 0 as last argument to
cpp_handle_option.
PR c/2896:
* gcc.c (cpp_unique_options): Split from cpp_options.
(cpp_options): Source cpp_unique_options.
(default_compilers): Use cpp_unique_options instead of cpp_options
when used together with cc1_options.
(static_specs): Add cpp_unique_options.
* objc/lang-specs.h: Use cpp_unique_options instead of cpp_options
when used together with cc1_options.
* decl2.c (cxx_decode_option): Pass 0 as last argument to
cpp_handle_option.
* lang-specs.h: Use cpp_unique_options instead of cpp_options
when used together with cc1_options.
From-SVN: r49315
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -673,10 +673,9 @@ static const char *link_libgcc_spec = LINK_LIBGCC_SPEC; static const char *trad_capable_cpp = "%{traditional|ftraditional|traditional-cpp:trad}cpp0"; -static const char *cpp_options = +static const char *cpp_unique_options = "%{C:%{!E:%eGNU C does not support -C without using -E}}\ - %{std*} %{nostdinc*}\ - %{C} %{v} %{I*} %{P} %{$} %I\ + %{nostdinc*} %{C} %{v} %{I*} %{P} %{$} %I\ %{MD:-M -MF %W{!o: %b.d}%W{o*:%.d%*}}\ %{MMD:-MM -MF %W{!o: %b.d}%W{o*:%.d%*}}\ %{M} %{MM} %W{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{M|MD|MM|MMD:%{o*:-MQ %*}}\ @@ -686,12 +685,17 @@ static const char *cpp_options = %{fno-inline|O0|!O*:-D__NO_INLINE__} %{ffast-math:-D__FAST_MATH__}\ %{fshort-wchar:-U__WCHAR_TYPE__ -D__WCHAR_TYPE__=short\\ unsigned\\ int}\ %{ffreestanding:-D__STDC_HOSTED__=0} %{fno-hosted:-D__STDC_HOSTED__=0}\ - %{!ffreestanding:%{!fno-hosted:-D__STDC_HOSTED__=1}}\ + %{!ffreestanding:%{!fno-hosted:-D__STDC_HOSTED__=1}} %{remap}\ + %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i\ + %{E:%{!M*:%W{o*}}}"; + +/* This contains cpp options which are common with cc1_options and are passed + only when preprocessing only to avoid duplication. */ +static const char *cpp_options = +"%(cpp_unique_options) %{std*} %{d*} %{W*} %{w} %{pedantic*}\ %{fshow-column} %{fno-show-column}\ %{fleading-underscore} %{fno-leading-underscore}\ - %{fno-operator-names} %{ftabstop=*} %{remap}\ - %{g3:-dD} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*&U*&A*} %{i*} %Z %i\ - %{E:%{!M*:%W{o*}}}"; + %{fno-operator-names} %{ftabstop=*}"; /* NB: This is shared amongst all front-ends. */ static const char *cc1_options = @@ -840,7 +844,7 @@ static const struct compiler default_compilers[] = tradcpp0 -lang-c %{ansi:-std=c89} %(cpp_options) %{!pipe:%g.i} |\n\ cc1 -fpreprocessed %{!pipe:%g.i} %(cc1_options)}\ %{!traditional:%{!ftraditional:%{!traditional-cpp:\ - cc1 -lang-c %{ansi:-std=c89} %(cpp_options) %(cc1_options)}}}}\ + cc1 -lang-c %{ansi:-std=c89} %(cpp_unique_options) %(cc1_options)}}}}\ %{!fsyntax-only:%(invoke_as)}}}}", 0}, {"-", "%{!E:%e-E required when input is from standard input}\ @@ -1367,6 +1371,7 @@ static struct spec_list static_specs[] = INIT_STATIC_SPEC ("invoke_as", &invoke_as), INIT_STATIC_SPEC ("cpp", &cpp_spec), INIT_STATIC_SPEC ("cpp_options", &cpp_options), + INIT_STATIC_SPEC ("cpp_unique_options", &cpp_unique_options), INIT_STATIC_SPEC ("trad_capable_cpp", &trad_capable_cpp), INIT_STATIC_SPEC ("cc1", &cc1_spec), INIT_STATIC_SPEC ("cc1_options", &cc1_options), |