public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] fix impliedness of -Wunused-parameter depending on -Wexta option ordering
@ 2014-05-08 21:20 Matthias Klose
  2014-05-08 21:37 ` Joseph S. Myers
  0 siblings, 1 reply; 10+ messages in thread
From: Matthias Klose @ 2014-05-08 21:20 UTC (permalink / raw)
  To: GCC Patches, Manuel López-Ibáñez

[-- Attachment #1: Type: text/plain, Size: 626 bytes --]

This fixes a regression introduced with 4.8, where the option ordering of
-Wextra and -Wunused-parameter emits a warning, which is not emitted with 4.7.
No regressions with the trunk, the 4.9 and 4.8 branches. Ok to check in for these?

  Matthias

2014-05-08  Manuel L<C3><B3>pez-Ib<C3><A1><C3><B1>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.



[-- Attachment #2: warn-unused.diff --]
[-- Type: text/plain, Size: 1976 bytes --]

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.

Index: gcc/optc-gen.awk
===================================================================
--- gcc/optc-gen.awk	(revision 210245)
+++ gcc/optc-gen.awk	(working copy)
@@ -406,11 +406,13 @@
         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: gcc/testsuite/gcc.dg/unused-8a.c
===================================================================
--- gcc/testsuite/gcc.dg/unused-8a.c	(revision 0)
+++ gcc/testsuite/gcc.dg/unused-8a.c	(working copy)
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall -Wextra -Wno-unused" } */
+
+void foo(int x) { }
Index: gcc/testsuite/gcc.dg/unused-8b.c
===================================================================
--- gcc/testsuite/gcc.dg/unused-8b.c	(revision 0)
+++ gcc/testsuite/gcc.dg/unused-8b.c	(working copy)
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall -Wno-unused -Wextra" } */
+
+void foo(int x) { }

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [patch] fix impliedness of -Wunused-parameter depending on -Wexta option ordering
@ 2014-05-09 14:41 Dominique Dhumieres
  0 siblings, 0 replies; 10+ messages in thread
From: Dominique Dhumieres @ 2014-05-09 14:41 UTC (permalink / raw)
  To: gcc-patches; +Cc: joseph, doko

> This fixes a regression introduced with 4.8, ...

This caused pr61126.

Dominique

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-05-14 21:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-08 21:20 [patch] fix impliedness of -Wunused-parameter depending on -Wexta option ordering Matthias Klose
2014-05-08 21:37 ` Joseph S. Myers
2014-05-12 16:14   ` Matthias Klose
2014-05-12 17:30     ` Joseph S. Myers
2014-05-12 19:27       ` Manuel López-Ibáñez
2014-05-12 20:24         ` Joseph S. Myers
2014-05-14 14:15           ` Manuel López-Ibáñez
2014-05-14 21:35             ` Joseph S. Myers
2014-05-14 16:43       ` Matthias Klose
2014-05-09 14:41 Dominique Dhumieres

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).