http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52347
--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- (In reply to Simon Richter from comment #4) > Testcase is simple: > > $ cat tt.cpp > > void bar(int baz) { } > > $ g++-4.7 -c -W -Wall -Werror -Wno-unused tt.cpp > > $ g++-4.8 -c -W -Wall -Werror -Wno-unused tt.cpp > tt.cpp:1:6: error: unused parameter ‘baz’ [-Werror=unused-parameter] > void bar(int baz) { } > ^ > cc1plus: all warnings being treated as errors There is a bug in the logic of the autogenerated code: if (!opts_set->x_warn_unused_parameter && (opts->x_warn_unused && opts->x_extra_warnings)) handle_generated_option (opts, opts_set, OPT_Wunused_parameter, NULL, value, lang_mask, kind, loc, handlers, dc); When processing -Wno-unused, opts->x_warn_unused is false, so we don't turn off OPT_Wunused_parameter. I think the generated code should be: if (!opts_set->x_warn_unused_parameter && opts->x_extra_warnings) for case OPT_Wunused and if (!opts_set->x_warn_unused_parameter && opts->x_warn_unused) for the case OPT_Wextra. So optc-gen.awk needs adjusting. Let me see if I can find time to do this in the coming weeks/months, but if anyone wants to investigate how to fix it, please go ahead. I think this is a different bug than the -Wno-tabs, since that is not handled by the autogenerated code.