yaneurao / YaneuraOu

YaneuraOu is the World's Strongest Shogi engine(AI player) , WCSC29 1st winner , educational and USI compliant engine.
GNU General Public License v3.0
512 stars 140 forks source link

Deal with `-Wbitwise-op-parentheses` #251

Closed koba-e964 closed 2 years ago

koba-e964 commented 2 years ago

clang++ でコンパイルすると以下のような警告が出力されます:

engine/yaneuraou-engine/../../bitboard.h:965:28: warning: '&' within '|' [-Wbitwise-op-parentheses]
                return Bitboard((em ^ t) & mask | (~mocc & se), 0);
                                ~~~~~~~~~^~~~~~ ~
engine/yaneuraou-engine/../../bitboard.h:965:28: note: place parentheses around the '&' expression to silence this warning
                return Bitboard((em ^ t) & mask | (~mocc & se), 0);
                                         ^
                                (              )
engine/yaneuraou-engine/../../bitboard.h:982:31: warning: '&' within '|' [-Wbitwise-op-parentheses]
                return Bitboard(0, (em ^ t) & mask | (~mocc & se));
                                   ~~~~~~~~~^~~~~~ ~
engine/yaneuraou-engine/../../bitboard.h:982:31: note: place parentheses around the '&' expression to silence this warning
                return Bitboard(0, (em ^ t) & mask | (~mocc & se));
                                            ^
                                   (              )

この PR ではそれに対処します。

yaneurao commented 2 years ago

ありがとうこざいます!!