]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
opts.h (CL_ERR_NEGATIVE): Define.
authorJoseph Myers <joseph@codesourcery.com>
Mon, 30 Aug 2010 10:30:57 +0000 (11:30 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Mon, 30 Aug 2010 10:30:57 +0000 (11:30 +0100)
* 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.

testsuite:
* gcc.dg/opts-1.c: Expect errors, not warnings.

From-SVN: r163637

gcc/ChangeLog
gcc/opts-common.c
gcc/opts.c
gcc/opts.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/opts-1.c

index 5a23b03dd397e5f5439756612f51cef1bdbd1b5b..37106bff88423310724c0fddf85a9161b9542330 100644 (file)
@@ -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
index cd4ec2b55868acea682d2351f48aa55d4ac6e20e..871e4662d3b91af3a748018a94adfe58f7669f14 100644 (file)
@@ -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;
     }
index d1f956889a92c4bfbadea1dfa3ba774e23b893f1..034157dc3584d4365dc0a92d43cf253d793cef1c 100644 (file)
@@ -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.  */
index 74e5733731de76c40071aa370e6bf536cb9ecb18..b2ff86c637b26808bfffac40945070b1914f1135 100644 (file)
@@ -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.  */
 
index fe9f0240bde57bf287fd735457cfc7df953619e4..984c2f45ef20b57507b22d3cc5fe533ebd6339f7 100644 (file)
@@ -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
index 0d16c3ded6e97317b231977f6747e40ba53d872c..3b90fe97dcc61b0c8e3584b1408a03946ca3f6b1 100644 (file)
@@ -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 } */