This is the mail archive of the
mailing list for the GCC project.
Re: diagnostics: %<%s%> vs. %qs
On Fri, 10 Mar 2017, Manuel López-Ibáñez wrote:
> On 07/03/17 20:38, Roland Illig wrote:
> > Hi,
> > in the diagnostics the %qs specifier is used in most of the cases. But
> > there are some cases left where the more complicated %<%s%> is used. Is
> > there a good reason to prefer the complicated spelling?
> > Same for %<%T%> and %qT, and similar letters.
> 'q' is a flag supported by some format codes but not all. Also, although
> different parts of the compiler may support the same format codes (%T), not
> all may have support for 'q' yet. Finally, there may be some code using %<%T%>
> that predates the existence of '%qT'.
The 'q' flag is part of the generic pretty-print.c:pp_format formatting.
Thus, everything using the generic pretty-printing can handle the 'q' flag
(whereas %T requires a function with support for the tree formats as well
as the base class ones).
Joseph S. Myers