VLA representation in GCC internals
Joseph Myers
josmyers@redhat.com
Mon Nov 11 21:01:59 GMT 2024
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
josmyers@redhat.com
More information about the Gcc
mailing list