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

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 25 09:45:20 PDT 2022


MaskRay added a comment.

In D126864#3609965 <https://reviews.llvm.org/D126864#3609965>, @xbolva00 wrote:

>>> -fsanitize=array-bounds workaround for size-1 array as the last member of a structure
>
> Could you provide option for that (to enable stricker bound checks introduced with this patch) ?

My commit just restored the previous -fsanitize=array-bounds behavior (as if the default is -fstrict-flex-arrays=1, different from Sema).
`-fstrict-flex-arrays=2` or above can make -fsanitize=array-bounds stricter.


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

https://reviews.llvm.org/D126864



More information about the cfe-commits mailing list