On 5/16/19 5:22 PM, Joseph Myers wrote:
On Tue, 14 May 2019, Martin Sebor wrote:

The attached patch fixes quoting, spelling, and other formatting
issues in diagnostics issued from files in the c-family/ directory
and pointed out by the -Wformat-diag warning.

Some of the changes in this patch are questionable.  The diagnostics for
attribute scalar_storage_order and visibility arguments use \" because the
argument is a string constant not an identifier.  So making those use %qs
makes the diagnostics misleading, by suggesting an attribute argument is
used that is not in fact valid for that attribute.

Hmm, yes.  I introduced it elsewhere as well in some of my prior
changes, and it existed even before then in handle_visibility_attribute:

    error ("%qD was declared %qs which implies default visibility",
           decl, "dllexport");

There is a way to highlight a string without enclosing it in both
single and double quotes:

    error ("attribute %qE argument must be one of %r%s%R or %r%s%R",
           name, "locus", "\"big-endian\"",
           "locus", "\"little-endian\"");

It's not pretty but it does the job.  Unless you know of some other
trick I'll go with it and fix up the existing mistakes the same way
in a followup commit.

Martin

Reply via email to