diff options
author | serge-sans-paille <sguelton@redhat.com> | 2022-06-02 08:53:45 +0200 |
---|---|---|
committer | serge-sans-paille <sguelton@redhat.com> | 2022-06-24 16:13:29 +0200 |
commit | 886715af962de2c92fac4bd37104450345711e4a (patch) | |
tree | 26398a53bb59d2a0d00dfd2b88f008c82cd7b80e /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 871197d0a38440835bb5ac17e70ab384e5616020 (diff) | |
download | llvm-886715af962de2c92fac4bd37104450345711e4a.zip llvm-886715af962de2c92fac4bd37104450345711e4a.tar.gz llvm-886715af962de2c92fac4bd37104450345711e4a.tar.bz2 |
[clang] Introduce -fstrict-flex-arrays=<n> for stricter handling of flexible arrays
Some code [0] consider that trailing arrays are flexible, whatever their size.
Support for these legacy code has been introduced in
f8f632498307d22e10fab0704548b270b15f1e1e but it prevents evaluation of
__builtin_object_size and __builtin_dynamic_object_size in some legit cases.
Introduce -fstrict-flex-arrays=<n> to have stricter conformance when it is
desirable.
n = 0: current behavior, any trailing array member is a flexible array. The default.
n = 1: any trailing array member of undefined, 0 or 1 size is a flexible array member
n = 2: any trailing array member of undefined or 0 size is a flexible array member
n = 3: any trailing array member of undefined size is a flexible array member (strict c99 conformance)
Similar patch for gcc discuss here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836
[0] https://docs.freebsd.org/en/books/developers-handbook/sockets/#sockets-essential-functions
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions