On 9/19/25 11:33, Peter Maydell wrote:
On Fri, 19 Sept 2025 at 09:37, Paolo Bonzini <[email protected]> wrote:

linux-user is failing to compile on Fedora 43:

../linux-user/strace.c:57:66: error: enum constant in boolean context 
[-Werror=int-in-bool-context]
    57 | #define FLAG_BASIC(V, M, N)      { V, M | 
QEMU_BUILD_BUG_ON_ZERO(!(M)), N }

The warning does not seem to useful and we could even disable it, but
the workaround is simple in this case.

I'm surprised this is the only place in the codebase
where we treat an int as a bool...
There are some heuristics about suspicious uses. Examples in the documentation include "if (a <= b ? 2 : 3)" and "1 << a" in boolean context.

Paolo


Reply via email to