Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support statement attributes #32

Open
lambdageek opened this issue May 20, 2017 · 0 comments
Open

Support statement attributes #32

lambdageek opened this issue May 20, 2017 · 0 comments

Comments

@lambdageek
Copy link

GCC Attribute Syntax allows the following:

In GNU C, an attribute specifier list may appear as part of a null statement. The attribute goes before the semicolon.

ie, this is currently a syntax error in language-c:

switch (e) {
  case 1:
         foo ();
         __attribute__((fallthrough)) ;
   default:
         bar ();
}

Unfortunately adding the naive additional production to statement leads to two extra shift/reduce conflicts and it's not obvious to me if they're benign or problematic.

statement ::
  ...
  | attrs ';'                   {% withNodeInfo $1 $ CAttrStmt $1 }
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant