optc-gen.awk: Emit #error for -W*/-f*/-m* Enum without RejectNegative.
authorJakub Jelinek <jakub@redhat.com>
Wed, 4 Jan 2017 21:26:50 +0000 (22:26 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 4 Jan 2017 21:26:50 +0000 (22:26 +0100)
* optc-gen.awk: Emit #error for -W*/-f*/-m* Enum without
RejectNegative.

From-SVN: r244073

gcc/ChangeLog
gcc/optc-gen.awk

index 242bf697bc457f47912f0b20841ffede230793a8..5181fe80e06a620976c4cbe09b6bd94a87afed7b 100644 (file)
@@ -1,5 +1,8 @@
 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
 
+       * optc-gen.awk: Emit #error for -W*/-f*/-m* Enum without
+       RejectNegative.
+
        * dwarf2out.c (output_loc_list): Don't throw away 64K+ location
        descriptions for -gdwarf-5 and emit them as uleb128 instead of
        2-byte data.
index dd2251566be6b5cd6957790d2b8b8c3d1a949992..cb3214a711cd9ac89e3e51c606cae49b5d505a31 100644 (file)
@@ -326,6 +326,11 @@ for (i = 0; i < n_opts; i++) {
                        alias_data = "NULL, NULL, OPT_SPECIAL_ignore"
                else
                        alias_data = "NULL, NULL, N_OPTS"
+               if (flag_set_p("Enum.*", flags[i])) {
+                       if (!flag_set_p("RejectNegative", flags[i]) \
+                           && opts[i] ~ "^[Wfm]")
+                               print "#error Enum allowing negative form"
+               }
        } else {
                alias_opt = nth_arg(0, alias_arg)
                alias_posarg = nth_arg(1, alias_arg)