[PATCH] D126864: [clang] Introduce -fstrict-flex-arrays for stricter handling of flexible arrays

Kees Cook via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 15 10:03:49 PDT 2022


kees added a comment.

In D126864#3584536 <https://reviews.llvm.org/D126864#3584536>, @serge-sans-paille wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836 does toward `-fstrict-flex-arrays=<n>` with
>
> - `n=0` ⇒ `-fno-strict-flex-arrays`, current state (the default)
> - `n=1` ⇒ only consider `[ 0]`, `[1}` and `[ ]` as flex array member
> - `n=2` ⇒ only consider `[ 0]` and `[ ]` as flex array member
> - `n=3` ⇒ only consider `[ ]` as flex array member
>
> I personnally like that approach, and I'd rather land that implementation.

Sounds good to me!


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

https://reviews.llvm.org/D126864



More information about the cfe-commits mailing list