GCC 5.1 and UndefinedBehaviorSanitizer gained a few new sanitization options

Jonathan Wakely jwakely.gcc@gmail.com
Thu Mar 24 10:38:00 GMT 2016


On 24 March 2016 at 03:53, Jeffrey Walton wrote:
> When using GCC 5.1 or above with -fsanitize=undefined, are these
> checks included? Or do they need to be enabled individually? The
> reason I ask is bounds checking, alignment checking and object type
> violations are clearly UB in C/C++, so I'm thinking they should be
> enabled for -fsanitize=undefined.

Yes, most of them are enabled by -fsanitize=undefined, except as noted
in the manual:

Unlike other similar options, -fsanitize=float-divide-by-zero is not
enabled by -fsanitize=undefined, [...]..
Unlike other similar options, -fsanitize=float-cast-overflow is not
enabled by -fsanitize=undefined.



More information about the Gcc-help mailing list