|
From: | Richard Henderson |
Subject: | Re: [PATCH v4 4/4] target/ppc: fix warning with clang-15 |
Date: | Tue, 21 Feb 2023 13:43:47 -1000 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 |
On 2/21/23 12:30, Philippe Mathieu-Daudé wrote:
On 21/2/23 16:30, Pierrick Bouvier wrote:When compiling for windows-arm64 using clang-15, it reports a sometimes uninitialized variable. This seems to be a false positive, as a default case guards switch expressions, preventing to return an uninitialized value, but clang seems unhappy with assert(0) definition.$ git grep 'assert(0)' | wc -l 96 Should we mass-update and forbid 'assert(0)' adding a check in scripts/checkpatch.pl? Otherwise we'll keep getting similar clang warnings...
I just think assert(0) produces a less clean error message, so on that basis yes, we should replace them all. Perhaps abort() as well, unless there's an error_report immediately preceding.
The fact that assert(0) was seen to fall through is a system header bug. I see we have a workaround in include/qemu/osdep.h for __MINGW32__, but I guess this doesn't trigger for arm64? Pierrick, would you mind testing a change there?
r~
[Prev in Thread] | Current Thread | [Next in Thread] |