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:
| I wonder whether %D and similar should default to being quoted (with some
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"
| flag for the few places they aren't), and whether in general any such
| global diagnostics change should use special formats
|
| %` 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.
| ... (I'd rather distinguish the flags for quoting strings and unquoting
| decls, but %Q is already used in the C++ front end; it could be
| reassigned.)
I do believe that %Q should be reassigned -- I came to the same
conclusion when I wanted to solve properly PR 712 which is open since
ages. It is fa better properly solved with a clear quote marker.
| This would allow for future refinements to C locale quoting when the
| character set permits. It does however presume that each language has a
| single left-quote string and a single right-quote string that are
| appropriate in all cases of quoting.
Well, that is a good starting point.
-- Gaby