<p dir="ltr">OK, that makes some sense, since the pragma acts like a statement that cannot have an attribute.</p>
<div class="gmail_quote">On 1 Oct 2013 05:26, "Aaron Ballman" <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Mon, Sep 30, 2013 at 6:03 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>
> It should be possible to handle this case without tentative parsing or<br>
> lookahead. Consume the attributes onto a new list; if the next token is a<br>
> semicolon, then push them into the label's attribute list; otherwise,<br>
> ParseStatementOrDeclarationAfterAttributes.<br>
<br>
Ah, thanks!<br>
<br>
> What does GCC do if there are #pragmas between the case label and the<br>
> attribute, and/or between the attribute and the semicolon?<br>
<br>
void func(void) {<br>
label: __attribute__((unused))<br>
#pragma message "stuff"<br>
;<br>
}<br>
<br>
Prints the message, no warning about the label or the attribute.<br>
<br>
void func(void) {<br>
label:<br>
#pragma message "stuff"<br>
__attribute__((unused))<br>
;<br>
}<br>
<br>
Prints the message, then prints an error about expecting an expression<br>
before the attribute, and a warning for the label being unused.<br>
<br>
~Aaron<br>
</blockquote></div>