diff options
| author | 2025-12-14 21:55:46 +0100 | |
|---|---|---|
| committer | 2025-12-14 21:55:46 +0100 | |
| commit | 450869ce81b72c7380b4c83149fb39f9f66f28dc (patch) | |
| tree | 0903077e91ebf4d72c23ed6750290aaf884f44e9 /c | |
| parent | 1339b832245fc6c1a5a9e7acf88c5b1f1f5f740f (diff) | |
c: as a hack, warn for zero-length array instead of error
Treated as unsized array T[]. This shows up in some linux headers
as a non-standard way to have flexible array members.
Diffstat (limited to 'c')
| -rw-r--r-- | c/c.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2429,7 +2429,7 @@ decltypes(struct comp *cm, struct decllist *list, const char **name, struct span } else if (ex.u > (1ull << (8*sizeof n)) - 1) { error(&ex.span, "array too long (%ul)", ex.u); } else if (ex.u == 0) { - error(&ex.span, "array cannot have zero length"); + warn(&ex.span, "array cannot have zero length"); } else { n = ex.u; } |