[PATCH 2/4] c/c++, asm: Use nicer error for duplicate asm qualifiers

Segher Boessenkool segher@kernel.crashing.org
Wed Dec 12 17:50:00 GMT 2018

On Tue, Dec 11, 2018 at 10:31:02AM -0700, Martin Sebor wrote:
> >+	    {
> >+	      error_at (loc, "duplicate asm qualifier %qE", token->value);
> We have been making an effort to quote keywords, identifiers,
> option names, and other such things in diagnostics.  In
> the message above and all others like it in this patch kit
> that mention "asm" the keyword should be quoted the same
> way as the name of the qualifier.

This message is about "asm qualifiers".  It is not about the "asm"
statement.  You can write this without "asm" keyword, too, anyway (with
an "__asm__" or such), making the message even more awkward to quote in
that case.  The location of the error has nothing to do with the "asm",

You should only quote keywords that are in the source text.  Not random
words that *could* be a keyword :-)


More information about the Gcc-patches mailing list