OSDN Git Service

* opts.h (CL_ERR_NEGATIVE): Define.
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Aug 2010 10:30:57 +0000 (10:30 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Aug 2010 10:30:57 +0000 (10:30 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163637 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 5a23b03..37106bf 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 cd4ec2b..871e466 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 d1f9568..034157d 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 74e5733..b2ff86c 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 fe9f024..984c2f4 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 0d16c3d..3b90fe9 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 } */