Repository navigation
Commit c9f8dde
gh-162182: Fix c-analyzer on static_assert containing a comma
With -std=c99, glibc expands `static_assert(cond, msg)` to a declaration
that has cond in a struct bitfield size. For example
static_assert(offsetof(T, m) >= 1, "msg");
is preprocessed to
extern int (*__Static_assert_function (void))
[!!sizeof (struct { int __error_if_negative:
(__builtin_offsetof (T, m) >= 1) ? 2 : -1; })];
The parser ended the size at the first comma, the one in "(T, m)",
which left it out of sync and `make check-c-globals` failed with
"too many lines".
Let a bitfield size containing parentheses run to the ";".
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>1 parent 715d34f commit c9f8dde
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
344 | 347 | | |
345 | 348 | | |
346 | 349 | | |
| |||
0 commit comments