public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* diagnostics: %<%s%> vs. %qs
@ 2017-03-07 20:38 Roland Illig
  2017-03-10  7:57 ` Manuel López-Ibáñez
  0 siblings, 1 reply; 3+ messages in thread
From: Roland Illig @ 2017-03-07 20:38 UTC (permalink / raw)
  To: gcc

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.

Regards,
Roland

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: diagnostics: %<%s%> vs. %qs
  2017-03-07 20:38 diagnostics: %<%s%> vs. %qs Roland Illig
@ 2017-03-10  7:57 ` Manuel López-Ibáñez
  2017-03-10 17:26   ` Joseph Myers
  0 siblings, 1 reply; 3+ messages in thread
From: Manuel López-Ibáñez @ 2017-03-10  7:57 UTC (permalink / raw)
  To: Roland Illig, GCC Development

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'.

Ideally, we should move all the code to use 'q' and leave %<%> for specific 
cases like quoting text: "%<--help%>"

Any help on this is appreciated: 
https://gcc.gnu.org/wiki/GettingStarted#Basics:_Contributing_to_GCC_in_10_easy_steps

Cheers,

Manuel.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: diagnostics: %<%s%> vs. %qs
  2017-03-10  7:57 ` Manuel López-Ibáñez
@ 2017-03-10 17:26   ` Joseph Myers
  0 siblings, 0 replies; 3+ messages in thread
From: Joseph Myers @ 2017-03-10 17:26 UTC (permalink / raw)
  To: Manuel López-Ibáñez; +Cc: Roland Illig, GCC Development

[-- Attachment #1: Type: text/plain, Size: 951 bytes --]

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
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-10 17:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-07 20:38 diagnostics: %<%s%> vs. %qs Roland Illig
2017-03-10  7:57 ` Manuel López-Ibáñez
2017-03-10 17:26   ` Joseph Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).