[PATCH] D132952: [Sema] disable -Wvla for function array parameters

YingChi Long via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 6 17:36:57 PDT 2022


inclyc added a comment.

> Yeah, that's a different way of delineating than I was thinking originally and it's worth more thought. I was thinking the separation would be "this is a VLA" (for people who want to avoid all VLA stack allocations due to the security concerns) and "this is a portability concern" (for people who want to port to older language standards, C++, other compilers).

I think it is a good idea to separate `-Wvla` into `-Wvla-portability`(warnings on portability) and `-Wvla-stack` (warnings on stack allocations, security issue). Report `-Wvla-portability` if compilers implementations in practice don't support any `vla` syntax especially in C89 mode and report `-Wvla-stack` if it causes stack allocations.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132952



More information about the cfe-commits mailing list