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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I'd say it is similar with shifts, the diagnostics about the shift count being
negative or too large is highly useful, the diagnostics about the various
lshift properties shifting into sign bit or shifting left negative values etc.)
are pedantic, at least GCC doesn't really take any advantage of that, because
there are so many different variants of the restrictions.
But for shifts we indeed do have a way to selectively turn one or the other on
or off.
So perhaps -fsanitize=vla can be a union of two subooptions too.
Though, we can't really do anything about this until upstream libsanitizer is
changed, because the diagnostics comes from that library.
And it would be really confusing to just do this on the GCC side, allow
VLA checks of <= 0 (=vla), < 0 (=vla-negative), == 0 (=vla-zero) and use the
same library routine in all cases that would always talk about non-positive
value.

Reply via email to