Unfortunately, ubsan is not implemented on all targets, as I just found out a few seconds ago trying to enable it on my arm-none-eabi project. (I suppose technically I just need to implement all of the stubs to hard fault or something... why doesn't gcc do that for me?).
> UBSan modifies the program at compile-time to catch various kinds of undefined behavior during program execution
Which makes it unusable with binary libraries.
It’s not intended to be something you ship.
Plenty of us link to binary libraries.
UBSan is awesome, but you need an awesome test suite to really unlock its power.
https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
UndefinedBehaviorSanitizer (UBSan) is a fast undefined behavior detector. UBSan modifies the program at compile-time to catch various kinds of undefined behavior during program execution, for example:
- Using misaligned or null pointer
- Signed integer overflow
- Conversion to, from, or between floating-point types which would overflow the destination
GCC has similar features.