Skip to content

Commit b5f53d6

Browse files
Allow strange corner case arising when including stdnoreturn.h despite using GCC noreturn attribute
1 parent 2f4b4fa commit b5f53d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/frontc/cparser.mly

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,9 @@ pragma:
13611361
/* (* We want to allow certain strange things that occur in pragmas, so we
13621362
* cannot use directly the language of expressions *) */
13631363
primary_attr:
1364-
IDENT { VARIABLE (fst $1) }
1364+
IDENT { VARIABLE (fst $1) }
1365+
/* (* This is just so code such as __attribute(_NoReturn) is not rejected, which may arise when combining GCC noreturn attribute and including C11 stdnoreturn.h *) */
1366+
| NORETURN { VARIABLE ("__noreturn__") }
13651367
/*(* The NAMED_TYPE here creates conflicts with IDENT *)*/
13661368
| NAMED_TYPE { VARIABLE (fst $1) }
13671369
| LPAREN attr RPAREN { $2 }

0 commit comments

Comments
 (0)