diff options
| author | 2023-06-26 17:24:51 +0200 | |
|---|---|---|
| committer | 2023-06-26 17:25:04 +0200 | |
| commit | 3b96204593b9812674126bad8de14419009682c8 (patch) | |
| tree | ec5a470ad20e36ed227178eb4ac91754c3d57dff | |
| parent | 80ee6292c33b6342e97c46af9577a588f9fabd4a (diff) | |
also C23 static_assert
| -rw-r--r-- | c.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1678,9 +1678,9 @@ pstaticassert(struct comp *cm, struct span *span) joinspan(&span->ex, tk.span.ex); if (!msg.t && ccopt.cstd == STDC11) - warn(span, "_Static_assert without message is a C23 extension"); + warn(span, "static assert without message is a C23 extension"); if (!eval(&ex, EVINTCONST)) { - error(&ex.span, "_Static_assert expression is not an integer constant"); + error(&ex.span, "static assert expression is not an integer constant"); } else if (iszero(ex)) { if (msg.t) error(&ex.span, "static assertion failed: %'S", msg.s, msg.len); @@ -1703,7 +1703,7 @@ pdecl(struct declstate *st, struct comp *cm) { } if (!st->base.t) { - if (staticassertok && match(cm, &tk, TKW_Static_assert)) { + if (staticassertok && (match(cm, &tk, TKW_Static_assert) || match(cm, &tk, TKWstatic_assert))) { pstaticassert(cm, &tk.span); return decl = (struct decl){0}; } |