aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppinit.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2002-01-29 13:09:37 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2002-01-29 13:09:37 +0100
commitffdeea47b90c0c898219ac96df667012fe9fb739 (patch)
tree1cb6969668582a88e15febb0d2435a1ddd4ca215 /gcc/cppinit.c
parentb8b98c66af69365e645718d3bf72ccabaa6ef2ab (diff)
downloadgcc-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/cppinit.c')
-rw-r--r--gcc/cppinit.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index c0f0348..ab3dad7 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -1317,12 +1317,14 @@ parse_option (input)
/* Handle one command-line option in (argc, argv).
Can be called multiple times, to handle multiple sets of options.
+ If ignore is non-zero, this will ignore unrecognized -W* options.
Returns number of strings consumed. */
int
-cpp_handle_option (pfile, argc, argv)
+cpp_handle_option (pfile, argc, argv, ignore)
cpp_reader *pfile;
int argc;
char **argv;
+ int ignore;
{
int i = 0;
struct cpp_pending *pend = CPP_OPTION (pfile, pending);
@@ -1733,6 +1735,8 @@ cpp_handle_option (pfile, argc, argv)
CPP_OPTION (pfile, warnings_are_errors) = 0;
else if (!strcmp (argv[i], "-Wno-system-headers"))
CPP_OPTION (pfile, warn_system_headers) = 0;
+ else if (! ignore)
+ return i;
break;
}
}
@@ -1754,7 +1758,7 @@ cpp_handle_options (pfile, argc, argv)
for (i = 0; i < argc; i += strings_processed)
{
- strings_processed = cpp_handle_option (pfile, argc - i, argv + i);
+ strings_processed = cpp_handle_option (pfile, argc - i, argv + i, 1);
if (strings_processed == 0)
break;
}