On Tue, Sep 14, 2021 at 11:32:13AM +0200, Martin Liška wrote:
> On 9/10/21 15:05, Basile Starynkevitch wrote:
> > In the Bismon static source code analyzer on 
> > https://github.com/bstarynk/bismon/ commit ad8b6270691e
> > 
> > (funded by http://decoder-project.eu/ ....) which contains some GPLv3+ GCC 
> > plugin code under directory gccplugins/
> > 
> > I am getting when compiling it
> > 
> > 
> > gcc10_metaplugin_BMGCC.cc: In function ‘int plugin_init(plugin_name_args*, 
> > plugin_gcc_version*)’:
> > gcc10_metaplugin_BMGCC.cc:165:85: warning: unquoted whitespace character 
> > ‘\x0a’ in format [-Wformat-diag]
> >    165 |     warning(UNKNOWN_LOCATION, "BISMON GCC10 METAPLUGIN: datestamp 
> > difference for %s:\n"
> > | ^~~
> >    166 |      " plugin has %s, GCC had %s; this is risky.",
> >        | ~~
> > gcc10_metaplugin_BMGCC.cc:169:84: warning: unquoted whitespace character 
> > ‘\x0a’ in format [-Wformat-diag]
> >    169 |     warning(UNKNOWN_LOCATION, "BISMON GCC10 METAPLUGIN: devphase 
> > difference for %s:\n"
> > | ^~~
> >    170 |      " plugin has %s, GCC had %s; this is risky.",
> >        | ~~
> > gcc10_metaplugin_BMGCC.cc:174:89: warning: unquoted whitespace character 
> > ‘\x0a’ in format [-Wformat-diag]
> >    174 |     warning(UNKNOWN_LOCATION, "BISMON GCC10 METAPLUGIN: 
> > configuration difference for %s:\n"
> > | ^~~
> >    175 |      " plugin has %s, GCC had %s; this is risky.",
> >        | ~~
> > gcc10_metaplugin_BMGCC.cc: In function ‘void parse_plugin_arguments(const 
> > char*, plugin_name_args*)’:
> > gcc10_metaplugin_BMGCC.cc:405:53: warning: unquoted sequence of 2 
> > consecutive space characters in format [-Wformat-diag]
> >    405 |         inform (UNKNOWN_LOCATION, "Bismon plugin %qs (%s:%d) will 
> > handle GCC include-file events with prefix %qs",
> >        |                                                     ^~
> > 
> 
> The warning -Wformat-diag is internal GCC warning that hasn't been 
> documented. I'm CC'ing the warning author.

Yeah.  But the warning is correct, one shouldn't have \n in warning/error
etc. format strings, instead one can emit multiple warnings perhaps in a
warning group, or a warning followed by inform, in any case the follow-up
diagnostic should be done only if the first warning returned true.

        Jakub

Reply via email to