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

--- Comment #3 from Aaron Ballman <aaron at aaronballman dot com> ---
(In reply to Andrew Pinski from comment #1)
> Since VLA support has been a GNU C++ extension way before it was proposed to
> WG21, I doubt we want to enable this by default.

I think it boils down to whether you think users are using it on purpose or by
accident. My experience has been that more people use this by accident than not
in C++ and are unhappily surprised when they learn of it (sometimes by porting
to other compilers (like MSVC) that don't have the extension, sometimes through
other means like static analysis, etc). Given that there are security
implications with them, they're very easy to use accidentally, there are more
idiomatic approaches like std::vector, and that code generation can be quite a
bit slower for VLAs than other approaches, I think warning on them by default
is justifiable (the folks using them on purpose can add -Wno-vla to disable the
diagnostic, but I honestly expect them to be in the minority).

Do you have evidence there's a lot of intentional use of this feature in C++ in
the wild?

Reply via email to