]> gcc.gnu.org Git - gcc.git/commitdiff
c.opt (--pedantic-errors,-pedantic-errors): Do not handle here.
authorManuel López-Ibáñez <manu@gcc.gnu.org>
Thu, 17 May 2012 11:50:37 +0000 (11:50 +0000)
committerManuel López-Ibáñez <manu@gcc.gnu.org>
Thu, 17 May 2012 11:50:37 +0000 (11:50 +0000)
2012-05-17  Manuel López-Ibáñez  <manu@gcc.gnu.org>

c-family/
* c.opt (--pedantic-errors,-pedantic-errors): Do not handle here.
* c-opts.c (c_common_handle_option): Do not handle explicitly
Wreturn-type, Wwrite-strings, warn_ecpp, and -pedantic-errors.
gcc/
* opts.c (common_handle_option): -pedantic-errors enables -Wpedantic.
(enable_warning_as_error): Do not special case Wuninitialized.
* optc-gen.awk: Add sanity checks.

From-SVN: r187628

gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-opts.c
gcc/c-family/c.opt
gcc/optc-gen.awk
gcc/opts.c

index 65f76b4653c37a60951aae9692b14a7076924801..425ebfd5fca2aba7fbc363f4769634f3abe548cf 100644 (file)
@@ -1,3 +1,9 @@
+2012-05-17  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       * opts.c (common_handle_option): -pedantic-errors enables -Wpedantic.
+       (enable_warning_as_error): Do not special case Wuninitialized.
+       * optc-gen.awk: Add sanity checks.
+
 2012-05-17  Jan Hubicka   <jh@suse.cz>
 
        * ipa-reference.c (is_proper_for_analysis): Do not check flags
index 0229a92000aa022329deac73ac2384890bf55cc3..1a84751f3c7454edf8e4915195bbb6b6bb7adfcf 100644 (file)
@@ -1,3 +1,9 @@
+2012-05-17  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       * c.opt (--pedantic-errors,-pedantic-errors): Do not handle here.
+       * c-opts.c (c_common_handle_option): Do not handle explicitly
+       Wreturn-type, Wwrite-strings, warn_ecpp, and -pedantic-errors.
+
 2012-05-16  Dodji Seketeli  <dodji@redhat.com>
 
        PR preprocessor/7263
index a7fadc817aa473bdcf94d67715f39880ca1b14a8..c493c1096f3b3895a3c5c6236219e8bc36d2d879 100644 (file)
@@ -510,10 +510,6 @@ c_common_handle_option (size_t scode, const char *arg, int value,
          break;
        }
 
-    case OPT_Wreturn_type:
-      warn_return_type = value;
-      break;
-
     case OPT_Wtraditional:
       cpp_opts->cpp_warn_traditional = value;
       break;
@@ -540,12 +536,7 @@ c_common_handle_option (size_t scode, const char *arg, int value,
       warn_variadic_macros = value;
       break;
 
-    case OPT_Wwrite_strings:
-      warn_write_strings = value;
-      break;
-
     case OPT_Weffc__:
-      warn_ecpp = value;
       if (value)
         warn_nonvdtor = true;
       break;
@@ -740,10 +731,9 @@ c_common_handle_option (size_t scode, const char *arg, int value,
        error ("output filename specified twice");
       break;
 
-      /* We need to handle the -Wpedantic switches here, rather than in
+      /* We need to handle the -Wpedantic switch here, rather than in
         c_common_post_options, so that a subsequent -Wno-endif-labels
         is not overridden.  */
-    case OPT_pedantic_errors:
     case OPT_Wpedantic:
       cpp_opts->cpp_pedantic = 1;
       cpp_opts->warn_endif_labels = 1;
index 0f13dc34eef31bb1e8126aaeb61befa97067e1d0..53d97521b1cebaabc61fda6ebd93bf52d94f8476 100644 (file)
@@ -142,9 +142,6 @@ C ObjC C++ ObjC++ Joined Separate
 -pedantic
 C ObjC C++ ObjC++ Alias(pedantic)
 
--pedantic-errors
-C ObjC C++ ObjC++ Alias(pedantic-errors)
-
 -preprocess
 C ObjC C++ ObjC++ Undocumented Alias(E)
 
@@ -1203,10 +1200,6 @@ pedantic
 C ObjC C++ ObjC++ Alias(Wpedantic)
 ; Documented in common.opt
 
-pedantic-errors
-C ObjC C++ ObjC++
-; Documented in common.opt
-
 print-objc-runtime-info
 ObjC ObjC++
 Generate C header of platform-specific features
index 1d46a5dc3c9177a667034f57009df3b93669e432..0abe6bcf2a8e67090a210d600f3d25bdef231d34 100644 (file)
@@ -391,10 +391,14 @@ for (i = 0; i < n_enabledby; i++) {
     n_enables = split(enables[enabledby_name], thisenable, ",");
     for (j = 1; j < n_enables; j++) {
         opt_var_name = var_name(flags[opt_numbers[thisenable[j]]]);
-        print "      if (!opts_set->x_" opt_var_name ")"
-        print "        handle_generated_option (opts, opts_set,"
-        print "                                 " opt_enum(thisenable[j]) ", NULL, value,"
-        print "                                 lang_mask, kind, loc, handlers, dc);"
+        if (opt_var_name != "") {
+            print "      if (!opts_set->x_" opt_var_name ")"
+            print "        handle_generated_option (opts, opts_set,"
+            print "                                 " opt_enum(thisenable[j]) ", NULL, value,"
+            print "                                 lang_mask, kind, loc, handlers, dc);"
+        } else {
+            print "#error " thisenable[j] " does not have a Var() flag"
+        }
     }
     print "      break;\n"
 }
@@ -430,10 +434,14 @@ for (i = 0; i < n_langs; i++) {
         n_enables = split(enables[lang_name,enabledby_name], thisenable, ",");
         for (j = 1; j < n_enables; j++) {
             opt_var_name = var_name(flags[opt_numbers[thisenable[j]]]);
-            print "      if (!opts_set->x_" opt_var_name ")"
-            print "        handle_generated_option (opts, opts_set,"
-            print "                                 " opt_enum(thisenable[j]) ", arg, value,"
-            print "                                 lang_mask, kind, loc, handlers, dc);"
+            if (opt_var_name != "") {
+                print "      if (!opts_set->x_" opt_var_name ")"
+                print "        handle_generated_option (opts, opts_set,"
+                print "                                 " opt_enum(thisenable[j]) ", arg, value,"
+                print "                                 lang_mask, kind, loc, handlers, dc);"
+            } else {
+                print "#error " thisenable[j] " does not have a Var() flag"
+            }
         }
         print "      break;\n"
     }
index ac43d4a2da7c391496e85edb7a776b6e8fe94e4e..58199c3bc3e74ac41945ddeeaace988bc9f1dc5f 100644 (file)
@@ -1712,8 +1712,11 @@ common_handle_option (struct gcc_options *opts,
       break;
 
     case OPT_pedantic_errors:
-      opts->x_pedantic = 1;
       dc->pedantic_errors = 1;
+      control_warning_option (OPT_Wpedantic, DK_ERROR, value,
+                             loc, lang_mask,
+                             handlers, opts, opts_set,
+                              dc);
       break;
 
     case OPT_flto:
@@ -2012,9 +2015,6 @@ enable_warning_as_error (const char *arg, int value, unsigned int lang_mask,
       control_warning_option (option_index, (int) kind, value,
                              loc, lang_mask,
                              handlers, opts, opts_set, dc);
-      if (option_index == OPT_Wuninitialized)
-        enable_warning_as_error ("maybe-uninitialized", value, lang_mask,
-                                handlers, opts, opts_set, loc, dc);
     }
   free (new_option);
 }
This page took 0.086856 seconds and 5 git commands to generate.