gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] gnugo-3.8 bug report


From: Gunnar Farnebäck
Subject: Re: [gnugo-devel] gnugo-3.8 bug report
Date: Wed, 7 Sep 2022 22:00:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0

Just turn off the warning or ignore it? This is clearly a false positive. Even the variable name indicates that xor is intended.

/Gunnar

On 9/7/22 17:32, David Binderman wrote:
Hello there,

Gcc has recently been extended with the warning for xor
used as pow. So:

1.

mkpat.c:1939:51: warning: result of '2^2' is 0; did you mean '1 << 2' (4)? 
[-Wxor-used-as-pow]

Source code is

      int xor_att = (el[k].color == color ? ATT_O ^ ATT_O : ATT_O ^ ATT_X);

I assume you meant

      int xor_att = (el[k].color == color) ? (ATT_O ^ ATT_O) : (ATT_O ^ ATT_X);

2.

mkpat.c:2005:55: warning: result of '2^1' is 3; did you mean '1 << 1' (2)? 
[-Wxor-used-as-pow]

Duplicate.

Regards

David Binderman



_______________________________________________
gnugo-devel mailing list
gnugo-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/gnugo-devel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]