summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/opts-common.c1
-rw-r--r--gcc/opts.c3
-rw-r--r--gcc/opts.h3
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/opts-1.c4
6 files changed, 20 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5a23b03dd39..37106bff884 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2010-08-30 Joseph Myers <joseph@codesourcery.com>
+
+ * opts.h (CL_ERR_NEGATIVE): Define.
+ * opts.c (unknown_option_callback): Don't postpone warnings for
+ options marked with CL_ERR_NEGATIVE.
+ * opts-common.c (decode_cmdline_option): Set CL_ERR_NEGATIVE error
+ for negative versions of CL_REJECT_NEGATIVE options.
+
2010-08-30 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (zero_extendsidi2_1): Rename from
diff --git a/gcc/opts-common.c b/gcc/opts-common.c
index cd4ec2b5586..871e4662d3b 100644
--- a/gcc/opts-common.c
+++ b/gcc/opts-common.c
@@ -197,6 +197,7 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
if (!value && (option->flags & CL_REJECT_NEGATIVE))
{
opt_index = OPT_SPECIAL_unknown;
+ errors |= CL_ERR_NEGATIVE;
arg = argv[0];
goto done;
}
diff --git a/gcc/opts.c b/gcc/opts.c
index d1f956889a9..034157dc358 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -482,7 +482,8 @@ unknown_option_callback (const struct cl_decoded_option *decoded)
{
const char *opt = decoded->arg;
- if (opt[1] == 'W' && opt[2] == 'n' && opt[3] == 'o' && opt[4] == '-')
+ if (opt[1] == 'W' && opt[2] == 'n' && opt[3] == 'o' && opt[4] == '-'
+ && !(decoded->errors & CL_ERR_NEGATIVE))
{
/* We don't generate warnings for unknown -Wno-* options unless
we issue diagnostics. */
diff --git a/gcc/opts.h b/gcc/opts.h
index 74e5733731d..b2ff86c637b 100644
--- a/gcc/opts.h
+++ b/gcc/opts.h
@@ -102,6 +102,9 @@ extern const unsigned int cl_lang_count;
#define CL_ERR_MISSING_ARG (1 << 1) /* Argument required but missing. */
#define CL_ERR_WRONG_LANG (1 << 2) /* Option for wrong language. */
#define CL_ERR_UINT_ARG (1 << 3) /* Bad unsigned integer argument. */
+#define CL_ERR_NEGATIVE (1 << 4) /* Negative form of option
+ not permitted (together
+ with OPT_SPECIAL_unknown). */
/* Structure describing the result of decoding an option. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fe9f0240bde..984c2f45ef2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2010-08-30 Joseph Myers <joseph@codesourcery.com>
+
+ * gcc.dg/opts-1.c: Expect errors, not warnings.
+
2010-08-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/42769
diff --git a/gcc/testsuite/gcc.dg/opts-1.c b/gcc/testsuite/gcc.dg/opts-1.c
index 0d16c3ded6e..3b90fe97dcc 100644
--- a/gcc/testsuite/gcc.dg/opts-1.c
+++ b/gcc/testsuite/gcc.dg/opts-1.c
@@ -5,5 +5,5 @@
/* { dg-error "-fno-abi-version" "-fno-abi-version" { target *-*-* } 0 } */
/* { dg-error "-fno-lto-compression-level" "-fno-lto-compression-level" { target *-*-* } 0 } */
/* { dg-error "-fno-tree-parallelize-loops" "-fno-tree-parallelize-loops" { target *-*-* } 0 } */
-/* { dg-warning "-Wno-strict-overflow" "-Wno-strict-overflow" { target *-*-* } 0 } */
-/* { dg-warning "-Wno-strict-aliasing" "-Wno-strict-aliasing" { target *-*-* } 0 } */
+/* { dg-error "-Wno-strict-overflow" "-Wno-strict-overflow" { target *-*-* } 0 } */
+/* { dg-error "-Wno-strict-aliasing" "-Wno-strict-aliasing" { target *-*-* } 0 } */