From ee8ea0873559dc4f8d629bc516286f30ee8db074 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez?= Date: Tue, 4 Mar 2008 20:28:52 +0000 Subject: [PATCH] re PR other/28322 (GCC new warnings and compatibility) 2008-03-04 Manuel Lopez-Ibanez PR 28322 * opts.c (handle_option): Postpone 'unknown option' errors only for warning options. testsuite/ * gcc.dg/pr28322-3.c: New. From-SVN: r132870 --- gcc/ChangeLog | 6 ++++++ gcc/opts.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr28322-3.c | 10 ++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/pr28322-3.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 38b3b1a..f0425f8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-03-04 Manuel Lopez-Ibanez + + PR 28322 + * opts.c (handle_option): Postpone 'unknown option' errors only for + warning options. + 2008-03-04 H.J. Lu PR target/35453 diff --git a/gcc/opts.c b/gcc/opts.c index 445cec3..528c8b8 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -505,7 +505,7 @@ handle_option (const char **argv, unsigned int lang_mask) opt = dup; value = 0; opt_index = find_opt (opt + 1, lang_mask | CL_COMMON | CL_TARGET); - if (opt_index == cl_options_count) + if (opt_index == cl_options_count && opt[1] == 'W') { /* We don't generate errors for unknown -Wno-* options unless we issue diagnostics. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1f364ee..da4f316 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-03-04 Manuel Lopez-Ibanez + + PR 28322 + * gcc.dg/pr28322-3.c: New. + 2008-03-04 H.J. Lu PR target/35453 diff --git a/gcc/testsuite/gcc.dg/pr28322-3.c b/gcc/testsuite/gcc.dg/pr28322-3.c new file mode 100644 index 0000000..7a5a4c5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr28322-3.c @@ -0,0 +1,10 @@ +/* PR28322: ignore unknown -Wno-* if no warning is emitted. */ +/* { dg-do compile } */ +/* { dg-options " -fno-foobar -mno-foobar" } */ + +void foo(void) +{ + int i = 1; +} +/* { dg-message "unrecognized command line option .-fno-foobar." "" { target *-*-* } 0 } */ +/* { dg-message "unrecognized command line option .-mno-foobar." "" { target *-*-* } 0 } */ -- 2.7.4