summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-04 20:28:52 +0000
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-04 20:28:52 +0000
commit88d4fcc4c1e6324da8e87f2075707573b6bd3c95 (patch)
treea4bcb1a165cff7bf3009a5e1b63f35b6f7e4fdd3
parentf98d7ce9315a4219dc737d1bc1aa71644b116530 (diff)
downloadppe42-gcc-88d4fcc4c1e6324da8e87f2075707573b6bd3c95.tar.gz
ppe42-gcc-88d4fcc4c1e6324da8e87f2075707573b6bd3c95.zip
2008-03-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 28322 * opts.c (handle_option): Postpone 'unknown option' errors only for warning options. testsuite/ * gcc.dg/pr28322-3.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132870 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/opts.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr28322-3.c10
4 files changed, 22 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 38b3b1a6d23..f0425f8b219 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2008-03-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 28322
+ * opts.c (handle_option): Postpone 'unknown option' errors only for
+ warning options.
+
2008-03-04 H.J. Lu <hongjiu.lu@intel.com>
PR target/35453
diff --git a/gcc/opts.c b/gcc/opts.c
index 445cec37296..528c8b83460 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 1f364ee8570..da4f3168ca8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-03-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 28322
+ * gcc.dg/pr28322-3.c: New.
+
2008-03-04 H.J. Lu <hongjiu.lu@intel.com>
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 00000000000..7a5a4c57901
--- /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 } */
OpenPOWER on IntegriCloud