[PATCH] D108230: [analyzer] Ignore single element arrays in getStaticSize() conditionally
Gábor Horváth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 21 15:57:44 PST 2022
xazax.hun added a comment.
I am a bit conflicted. It is unfortunate that C and C++ compilers regarded single element array members as flexible array members. On the other hand, looking at GCC, it recently added -fstrict-flex-arrays=2 <https://developers.redhat.com/articles/2022/09/29/benefits-limitations-flexible-array-members#nonconforming_compiler_extensions> as an option to no longer consider single element member arrays as FAM. So, it looks like the community wants to migrate away from this. My main concern is whether this option would make the experience for people worse for people who keep their code tidy and favor people who did not update their FAMs. Overall, I wonder if diagnosing single element arrays that are likely FAMs and suggesting users to fix their code is a better way forward.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108230/new/
https://reviews.llvm.org/D108230
More information about the cfe-commits
mailing list