This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug driver/61106] [4.8/4.9/4.10 Regression] impliedness of -Wunused-parameter depends on -W option ordering
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 08 May 2014 11:10:30 +0000
- Subject: [Bug driver/61106] [4.8/4.9/4.10 Regression] impliedness of -Wunused-parameter depends on -W option ordering
- Auto-submitted: auto-generated
- References: <bug-61106-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61106
--- Comment #4 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> ---
(In reply to Matthias Klose from comment #3)
> this leads to:
>
> if (!opts_set->x_warn_unused_but_set_variable)
> handle_generated_option (opts, opts_set,
> OPT_Wunused_but_set_variable, NULL, (),
> lang_mask, kind, loc, handlers, dc);
>
> and lets the compiler complain about:
>
> options.c:11506:71: error: expected primary-expression before ')' token
> OPT_Wunused_but_set_variable, NULL, (),
> ^
I guess it was too quick and dirty ;-)
What about this variant (just reversed the if-else condition)?
Index: optc-gen.awk
===================================================================
--- optc-gen.awk (revision 209347)
+++ optc-gen.awk (working copy)
@@ -404,15 +404,17 @@ for (i = 0; i < n_enabledby; i++) {
for (j = 1; j < n_enables; j++) {
opt_var_name = var_name(flags[opt_numbers[thisenable[j]]]);
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"
}
}