-fsanitize=undefined behavior

Jonathan Wakely jwakely.gcc@gmail.com
Thu Apr 30 21:57:49 GMT 2020


On Thu, 30 Apr 2020 at 22:27, Tom N <nospam@codesniffer.com> wrote:
>
> The man page for -fsanitize=undefined lists a bunch of sub-options (eg. -fsanitize=shift, -fsanitize=shift-exponent, etc).  If I include -fsanitize=undefined does it enable all of the sub-options, or none, or something in between?  If it doesn't enable all sub-options, is there an easy way to do that short of specifying all of them?

The man page says:

"Unlike other similar options, -fsanitize=float-divide-by-zero is not
enabled by -fsanitize=undefined" and "Unlike other similar options,
-fsanitize=float-cast-overflow is not enabled by -fsanitize=undefined"

So it seems reasonable to assume that all the other suboptions are
enabled by -fsanitize=undefined, and if you want *all* of them then
use -fsanitize=undefined -fsanitize=float-divide-by-zero
-fsanitize=float-cast-overflow


More information about the Gcc-help mailing list