https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94428

--- Comment #3 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #1)
> With the introduction of -Wzero-length-bounds in GCC 10 (which,
> incidentally, was added specifically to ease the adoption of the stricter
> array bounds checking in GCC 10 by the kernel), adding a knob to diagnose
> declarations of zero-length arrays sounds like a good idea to me.

Should we warn about this by default even, for new enough C versions?  So for
-std=c99 and later?  What about even for -std=gnu99 and later?

Warning for arrays of length 1 is more dubious.  If we really want that it
should be a separate option?

Reply via email to