re PR driver/61106 ([4.8/4.9] impliedness of -Wunused-parameter depends on -W option...
authorMatthias Klose <doko@gcc.gnu.org>
Thu, 8 May 2014 22:17:43 +0000 (22:17 +0000)
committerMatthias Klose <doko@gcc.gnu.org>
Thu, 8 May 2014 22:17:43 +0000 (22:17 +0000)
gcc/

2014-05-08  Manuel López-Ibáñez  <manu@gcc.gnu.org>
            Matthias Klose  <doko@ubuntu.com>

        PR driver/61106
        * optc-gen.awk: Fix option handling for -Wunused-parameter.

gcc/testsuite/

2014-05-08  Matthias Klose  <doko@ubuntu.com>

        PR driver/61106
        * gcc-dg/unused-8a.c: New.
        * gcc-dg/unused-8b.c: Likewise.

From-SVN: r210246

gcc/ChangeLog
gcc/optc-gen.awk
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/unused-8a.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/unused-8b.c [new file with mode: 0644]

index 89a88e2..8e8b76e 100644 (file)
@@ -1,3 +1,9 @@
+2014-05-08  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+           Matthias Klose  <doko@ubuntu.com>
+
+       PR driver/61106
+       * optc-gen.awk: Fix option handling for -Wunused-parameter.
+
 2014-05-08  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/59952
index a091b72..b70e4fe 100644 (file)
@@ -406,11 +406,13 @@ for (i = 0; i < n_enabledby; i++) {
         if (opt_var_name != "") {
             condition = "!opts_set->x_" opt_var_name
             if (thisenableif[j] != "") {
-                condition = condition " && (" thisenableif[j] ")"
+                value = "(" thisenableif[j] ")"
+            } else {
+                value = "value"
             }
             print "      if (" condition ")"
             print "        handle_generated_option (opts, opts_set,"
-            print "                                 " opt_enum(thisenable[j]) ", NULL, value,"
+            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"
index bbfb333..2dcf9dc 100644 (file)
@@ -1,3 +1,9 @@
+2014-05-08  Matthias Klose  <doko@ubuntu.com>
+
+       PR driver/61106
+       * gcc-dg/unused-8a.c: New.
+       * gcc-dg/unused-8b.c: Likewise.
+
 2014-05-08  Marek Polacek  <polacek@redhat.com>
 
        PR c/61053
diff --git a/gcc/testsuite/gcc.dg/unused-8a.c b/gcc/testsuite/gcc.dg/unused-8a.c
new file mode 100644 (file)
index 0000000..b9b5690
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall -Wextra -Wno-unused" } */
+
+void foo(int x) { }
diff --git a/gcc/testsuite/gcc.dg/unused-8b.c b/gcc/testsuite/gcc.dg/unused-8b.c
new file mode 100644 (file)
index 0000000..5b4b894
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall -Wno-unused -Wextra" } */
+
+void foo(int x) { }