https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67479
--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> --- On Mon, 7 Sep 2015, manu at gcc dot gnu.org wrote: > > 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)); This should not be a pedwarn, because it only has undefined behavior in ISO C at runtime, not compile time.