|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [PULL v2 05/13] target/rx: CPU definitions |
Date: | Sat, 21 Mar 2020 12:05:37 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 3/20/20 5:37 PM, Peter Maydell wrote:
On Fri, 20 Mar 2020 at 16:32, Philippe Mathieu-Daudé <address@hidden> 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,vptrThere 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?
I am sorry I am very confused here. $ clang -v clang version 8.0.0 (Fedora 8.0.0-3.fc30) I use scan-build which set CC=ccc-analyzer. $ ccc-analyzer -v gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC) I use the output of 'make V=1' and run directly ccc-analyzer, I get: gcc: error: unrecognized argument to ‘-fsanitize=’ option: ‘array-bounds’ gcc: error: unrecognized argument to ‘-fsanitize=’ option: ‘function’ So Clang is used.I notice ccc-analyzer appends -Wno-shift-negative-value, however if I run the 'make V=1' output using clang instead (with all the -fsanitize options, -fwrapv, -Wno-shift-negative-value) then no warning are emitted.
So I think this is simply a problem with scan-build/ccc-analyzer, or I should tune it more for QEMU.
[Prev in Thread] | Current Thread | [Next in Thread] |