[PATCH] D156565: Diagnose use of VLAs in C++ by default

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 31 12:23:06 PDT 2023


aaron.ballman added a comment.

In D156565#4543503 <https://reviews.llvm.org/D156565#4543503>, @aaron.ballman wrote:

> In D156565#4543414 <https://reviews.llvm.org/D156565#4543414>, @jrtc27 wrote:
>
>> Given GCC defines GNU C++ and regards this as a feature (unless you use things like -pedantic to ask for ISO C++), does it make sense to enable this for GNU C++?
>
> I think GCC should enable -Wvla by default in GNU C++ as well, for the same reasons I'm proposing it for Clang. I've filed an issue for it at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110848

The GCC conversation is leaning towards only diagnosing by default in C++ mode but not in GNU++ mode. I'm still trying to persuade them to diagnose in both modes one last time, but if it looks like they're firm about not diagnosing in GNU++ mode, I can live with that (for now). It at least improves our security posture a bit, so it's definitely a win.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156565/new/

https://reviews.llvm.org/D156565



More information about the cfe-commits mailing list