aboutsummaryrefslogtreecommitdiffhomepage
path: root/c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-12-14 21:55:46 +0100
committerlemon <lsof@mailbox.org>2025-12-14 21:55:46 +0100
commit450869ce81b72c7380b4c83149fb39f9f66f28dc (patch)
tree0903077e91ebf4d72c23ed6750290aaf884f44e9 /c
parent1339b832245fc6c1a5a9e7acf88c5b1f1f5f740f (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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/c/c.c b/c/c.c
index 49b17b2..a16bf80 100644
--- a/c/c.c
+++ b/c/c.c
@@ -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;
}