On Fri, 20 Mar 2020 at 16:32, Philippe Mathieu-Daudé <phi...@redhat.com> wrote: > -fwrapv is here indeed. > > I use > --extra-cflags=-fsanitize=address,alignment,array-bounds,bool,builtin,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,nonnull-attribute,null,pointer-overflow,return,returns-nonnull-attribute,shift-base,shift-exponent,signed-integer-overflow,unreachable,vla-bound,vptr
There was a bug in older clang versions where the shift-base sanitizer didn't honour -fwrapv: https://bugs.llvm.org/show_bug.cgi?id=25552 https://wiki.qemu.org/Testing#clang_UBSan says you can work around the clang bug with -fno-sanitize=shift-base. The bug was fixed upstream back in 2016, though, so the fix ought to be in clang 4, I think. Are you using an old clang version, or has it regressed in newer clang? thanks -- PMM