https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67479
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic, easyhack Status|UNCONFIRMED |NEW Last reconfirmed| |2015-09-07 CC| |manu at gcc dot gnu.org Version|unknown |6.0 Ever confirmed|0 |1 --- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- This should be easy to do and I think it would be accepted, you should really give it a try: https://gcc.gnu.org/wiki/GettingStarted#Basics:_Contributing_to_GCC_in_10_easy_steps In fact, such an option would allow fixing bugs such as this one: Index: c-format.c =================================================================== --- c-format.c (revision 227095) +++ c-format.c (working copy) @@ -1244,11 +1244,12 @@ return 0; } *format = fcp + 1; - if (pedantic && !dollar_format_warned) + if (warn_format_pedantic && !dollar_format_warned) { - warning (OPT_Wformat_, "%s does not support %%n$ operand number formats", - C_STD_NAME (STD_EXT)); - dollar_format_warned = 1; + dollar_format_warned = + pedwarn (input_location, OPT_Wformat_pedantic, + "%s does not support %%n$ operand number formats", + C_STD_NAME (STD_EXT)); } if (overflow_flag || argnum == 0 || (dollar_first_arg_num && argnum > dollar_arguments_count)) Since 'pedantic' should only be used in the cases described in the guidelines (https://gcc.gnu.org/wiki/DiagnosticsGuidelines) and "if(pedantic) warning()" is not one of them. (This means that every use of pedantic in c-format.c is currently a minor bug). Fixing this will also contribute towards fixing PR53075.