This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/4] c/c++, asm: Use nicer error for duplicate asm qualifiers
On Wed, Dec 12, 2018 at 11:02:29AM -0700, Martin Sebor wrote:
> On 12/12/18 10:50 AM, Segher Boessenkool wrote:
> >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",
> >either.
> >
> >You should only quote keywords that are in the source text. Not random
> >words that *could* be a keyword :-)
>
> asm is not a random word, or even an English word (please look
> in a dictionary if you're in doubt). It is a C/C++ keyword :-)
An "asm qualifier" is a GCC extension.
Segher