This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: code that could be improved
"Joseph S. Myers" <jsm@polyomino.org.uk> writes:
| On Tue, 2 Mar 2004, Gabriel Dos Reis wrote:
|
| > I don't think that default would be appropriate. There are common
| > situations where we want to say
| >
| > "fubar '%D::%T' is foo and bar"
|
| That seems quite rare; the bulk of uses are quoted on their own and there
| are a few cases that are unquoted for no obvious reason.
|
| decl.c: error ("explicit specialization of %D after first use",
| decl.c: error ("duplicate initialization of %D", decl);
| parser.c: error ("%D redeclared with different access", decl);
| pt.c: error ("specialization of %D after instantiation",
Those certainly are errors.
| > | %` for a left quote (' in C locale)
| > | %' for a right quote (' in C locale)
| > | %qs for quoted string
| > | %qD for unquoted decl
| >
| > I would prefer a simple
| >
| > %q for quoted tree or string
| >
| > There is no conceptual difference when a tree or string literal is
| > reported in diagnostics.
|
| We need %` and %' for all the cases such as '%D::%T' you gave where more
| than a single format specifier is quoted.
I agree on that.
| But where a single specifier is
| quoted, there is a case for consistency in use of %q even if this does
| mean almost all uses of %D become %qD.
this probably the piece I did not understand. I thought the proposal
would be
%`D%::%T%' for '%D::T'
and
%q%s or %q%D for "%s" and '%D'
Could you reformulate, please?
-- Gaby