On 20.10.26 14:37, David Geier wrote:
If we turned on -fstrict-flex-arrays=3, these would become undefined
behavior and trigger the ubsan sanitizer.
The compiler setting can be changed on a per-struct basis via
__attribute__((strict_flex_arrays(N)));
This only works with gcc, not clang, so it's not a viable solution.
clang has support for it starting with version 16.0, see [1]. Is that
clang version too recent to require it?
--
David Geier
[1] https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html
I don't see the attribute mentioned in the release notes. The only
thing related that I see in there is that that release now supports the
level 3 of -fstrict-flex-arrays where the previous versions only
supported up to 2. My testing confirms that no version of clang
supports the attribute.