This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 5.1 and UndefinedBehaviorSanitizer gained a few new sanitization options
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Jeffrey Walton <noloader at gmail dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 24 Mar 2016 10:38:23 +0000
- Subject: Re: GCC 5.1 and UndefinedBehaviorSanitizer gained a few new sanitization options
- Authentication-results: sourceware.org; auth=none
- References: <CAH8yC8nj0gaPRLhyRTutJkGMQyP-QjztRsemWnKPzyKRT3g2HQ at mail dot gmail dot com>
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.