From 450869ce81b72c7380b4c83149fb39f9f66f28dc Mon Sep 17 00:00:00 2001 From: lemon Date: Sun, 14 Dec 2025 21:55:46 +0100 Subject: 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. --- c/c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3