aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-02-17 09:32:44 +0100
committerRichard Biener <rguenther@suse.de>2020-02-17 09:32:44 +0100
commitabe13e1847fb91d43f02b5579c4230214d4369f4 (patch)
tree58d22bcff7bdf1921d341d26469524d0810cf02c
parentf76a88ebf089871dcce215aa0cb1956ccc060895 (diff)
downloadgcc-abe13e1847fb91d43f02b5579c4230214d4369f4.zip
gcc-abe13e1847fb91d43f02b5579c4230214d4369f4.tar.gz
gcc-abe13e1847fb91d43f02b5579c4230214d4369f4.tar.bz2
c/86134 avoid errors for unrecognized -Wno- options
This makes sure to not promote diagnostics about unrecognized -Wno- options to errors and make the intent of the diagnostic clearer. 2020-02-17 Richard Biener <rguenther@suse.de> PR c/86134 * opts-global.c (print_ignored_options): Use inform and amend message. * gcc.dg/pr86134.c: New testcase. * gcc.dg/pr28322-2.c: Adjust.
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/opts-global.c6
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/pr28322-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr86134.c6
5 files changed, 23 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5357acf..7c48140 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2020-02-17 Richard Biener <rguenther@suse.de>
+
+ PR c/86134
+ * opts-global.c (print_ignored_options): Use inform and
+ amend message.
+
2020-02-17 Jiufu Guo <guojiufu@linux.ibm.com>
PR target/93047
diff --git a/gcc/opts-global.c b/gcc/opts-global.c
index d5e308b..c658805 100644
--- a/gcc/opts-global.c
+++ b/gcc/opts-global.c
@@ -139,8 +139,10 @@ print_ignored_options (void)
const char *opt;
opt = ignored_options.pop ();
- warning_at (UNKNOWN_LOCATION, 0,
- "unrecognized command-line option %qs", opt);
+ /* Use inform, not warning_at, to avoid promoting these to errors. */
+ inform (UNKNOWN_LOCATION,
+ "unrecognized command-line option %qs may have been intended "
+ "to silence earlier diagnostics", opt);
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6c34e0b..b326529 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2020-02-17 Richard Biener <rguenther@suse.de>
+
+ PR c/86134
+ * gcc.dg/pr86134.c: New testcase.
+ * gcc.dg/pr28322-2.c: Adjust.
+
2020-02-17 David Malcolm <dmalcolm@redhat.com>
PR analyzer/93388
diff --git a/gcc/testsuite/gcc.dg/pr28322-2.c b/gcc/testsuite/gcc.dg/pr28322-2.c
index c9e5e22..20adf5e 100644
--- a/gcc/testsuite/gcc.dg/pr28322-2.c
+++ b/gcc/testsuite/gcc.dg/pr28322-2.c
@@ -8,5 +8,5 @@ int foo (void)
return i;
}
-/* { dg-warning "unrecognized command-line option .-Wno-foobar." "" { target *-*-* } 0 } */
+/* { dg-message "unrecognized command-line option .-Wno-foobar." "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/pr86134.c b/gcc/testsuite/gcc.dg/pr86134.c
new file mode 100644
index 0000000..3fd21a3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr86134.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall -Werror -Wno-error=main -Wno-foobar" } */
+
+void main() {} /* { dg-warning "return type" } */
+
+/* { dg-message "unrecognized command-line option" "" { target *-*-* } 0 } */