On Sat, 9 Nov 2024, Martin Uecker via Gcc wrote: > BTW: My main practical issue with zero-sized arrays is that the > UB sanitizers triggers for zero-sized variable arrays.
They are after all UB in standard C. (Note for example that the UB sanitizers cover all cases of shifts that are undefined in the standard for the relevant language version, although we explicitly do not treat various signed shift cases as UB for optimization purposes - the only ones considered UB for optimization are where the shift count is negative or at least the width of the type, not the other cases involving negative first argument or shifting into or past the sign bit. However, the floating cases -fsanitize=float-divide-by-zero and -fsanitize=float-cast-overflow, that are not UB in Annex F, are not included in -fsanitized=undefined.) -- Joseph S. Myers josmy...@redhat.com