ddugovic / Stockfish

Retired multi-variant fork of popular UCI chess engine; please use Fairy-Stockfish instead
https://github.com/ianfab/Fairy-Stockfish
GNU General Public License v3.0
132 stars 44 forks source link

Warnings in mingw compilation #231

Closed lantonov closed 7 years ago

lantonov commented 7 years ago

Although you may be aware of these, I will list them here because some of these warnings, in addition to being irritating, may indicate real problems in the code.

$ make build ARCH=x86-64-bmi2 COMP=mingw

Config: debug: 'no' sanitize: 'no' optimize: 'yes' arch: 'x86_64' bits: '64' kernel: 'MINGW64_NT-10.0' os: 'Windows_NT' prefetch: 'yes' popcnt: 'yes' sse: 'yes' pext: 'yes'

Flags: CXX: g++ CXXFLAGS: -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 LDFLAGS: -static

Testing config sanity. If this fails, try 'make help' ...

make ARCH=x86-64-bmi2 COMP=mingw all make[1]: Entering directory '/home/lanto/crazy' g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o benchmark.o benchmark.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o bitbase.o bitbase.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o bitboard.o bitboard.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o endgame.o endgame.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o evaluate.o evaluate.cpp evaluate.cpp: In instantiation of 'Score {anonymous}::evaluate_king(const Position&, const {anonymous}::EvalInfo&) [with Color Us = (Color)0u; bool DoTrace = true]': evaluate.cpp:1520:42: required from 'Value Eval::evaluate(const Position&) [with bool DoTrace = true]' evaluate.cpp:1577:53: required from here evaluate.cpp:825:54: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] kingDanger += QueenContactCheck * popcount(b & ei.attackedBy2[Them] |

evaluate.cpp:849:69: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] Bitboard dropSafe = (safe | ei.attackedBy[Them][ALL_PIECES] & dqo) & ~pos.pieces(Us);

evaluate.cpp:866:45: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] if (b1 & (ei.attackedBy[Them][ROOK] & safe | dropSafe & h))

evaluate.cpp:876:47: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] if (b2 & (ei.attackedBy[Them][BISHOP] & safe | dropSafe & h))

evaluate.cpp:888:15: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] if (b & safe | k & h & dropSafe) ^~~~ evaluate.cpp:891:25: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] else if ((b | k & h) & other) ^ evaluate.cpp: In instantiation of 'Score {anonymous}::evaluate_king(const Position&, const {anonymous}::EvalInfo&) [with Color Us = (Color)1u; bool DoTrace = true]': evaluate.cpp:1521:42: required from 'Value Eval::evaluate(const Position&) [with bool DoTrace = true]' evaluate.cpp:1577:53: required from here evaluate.cpp:825:54: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] kingDanger += QueenContactCheck * popcount(b & ei.attackedBy2[Them] |

evaluate.cpp:849:69: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] Bitboard dropSafe = (safe | ei.attackedBy[Them][ALL_PIECES] & dqo) & ~pos.pieces(Us);

evaluate.cpp:866:45: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] if (b1 & (ei.attackedBy[Them][ROOK] & safe | dropSafe & h))

evaluate.cpp:876:47: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] if (b2 & (ei.attackedBy[Them][BISHOP] & safe | dropSafe & h))

evaluate.cpp:888:15: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] if (b & safe | k & h & dropSafe) ^~~~ evaluate.cpp:891:25: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] else if ((b | k & h) & other) ^ evaluate.cpp: In instantiation of 'Score {anonymous}::evaluate_king(const Position&, const {anonymous}::EvalInfo&) [with Color Us = (Color)0u; bool DoTrace = false]': evaluate.cpp:1520:42: required from 'Value Eval::evaluate(const Position&) [with bool DoTrace = false]' evaluate.cpp:1578:53: required from here evaluate.cpp:825:54: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] kingDanger += QueenContactCheck * popcount(b & ei.attackedBy2[Them] |

evaluate.cpp:849:69: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] Bitboard dropSafe = (safe | ei.attackedBy[Them][ALL_PIECES] & dqo) & ~pos.pieces(Us);

evaluate.cpp:866:45: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] if (b1 & (ei.attackedBy[Them][ROOK] & safe | dropSafe & h))

evaluate.cpp:876:47: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] if (b2 & (ei.attackedBy[Them][BISHOP] & safe | dropSafe & h))

evaluate.cpp:888:15: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] if (b & safe | k & h & dropSafe) ^~~~ evaluate.cpp:891:25: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] else if ((b | k & h) & other) ^ evaluate.cpp: In instantiation of 'Score {anonymous}::evaluate_king(const Position&, const {anonymous}::EvalInfo&) [with Color Us = (Color)1u; bool DoTrace = false]': evaluate.cpp:1521:42: required from 'Value Eval::evaluate(const Position&) [with bool DoTrace = false]' evaluate.cpp:1578:53: required from here evaluate.cpp:825:54: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] kingDanger += QueenContactCheck * popcount(b & ei.attackedBy2[Them] |

evaluate.cpp:849:69: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] Bitboard dropSafe = (safe | ei.attackedBy[Them][ALL_PIECES] & dqo) & ~pos.pieces(Us);

evaluate.cpp:866:45: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] if (b1 & (ei.attackedBy[Them][ROOK] & safe | dropSafe & h))

evaluate.cpp:876:47: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] if (b2 & (ei.attackedBy[Them][BISHOP] & safe | dropSafe & h))

evaluate.cpp:888:15: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] if (b & safe | k & h & dropSafe) ^~~~ evaluate.cpp:891:25: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] else if ((b | k & h) & other) ^ g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o main.o main.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o material.o material.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o misc.o misc.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o movegen.o movegen.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o movepick.o movepick.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o pawns.o pawns.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o position.o position.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o psqt.o psqt.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o search.o search.cpp search.cpp: In function 'Value {anonymous}::search(Position&, Search::Stack, Value, Value, Depth, bool, bool)': search.cpp:916:28: warning: enumeral and non-enumeral type in conditional expression [-Wextra] && (pos.is_house() ? (eval < 2 VALUE_KNOWN_WIN

             && !(depth > 4 * ONE_PLY && pos.count_in_hand(~pos.side_to_move(), ALL_PIECES))) :
         pos.non_pawn_material(pos.side_to_move())))
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

search.cpp: In instantiation of 'Value {anonymous}::search(Position&, Search::Stack, Value, Value, Depth, bool, bool) [with {anonymous}::NodeType NT = (::NodeType)1u]': search.cpp:534:89: required from here cc1plus.exe: warning: enumeral and non-enumeral type in conditional expression [-Wextra] search.cpp: In instantiation of 'Value {anonymous}::search(Position&, Search::Stack, Value, Value, Depth, bool, bool) [with {anonymous}::NodeType NT = (::NodeType)0u]': search.cpp:933:56: required from 'Value {anonymous}::search(Position&, Search::Stack*, Value, Value, Depth, bool, bool) [with {anonymous}::NodeType NT = (::NodeType)1u]' search.cpp:534:89: required from here cc1plus.exe: warning: enumeral and non-enumeral type in conditional expression [-Wextra] g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o thread.o thread.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o timeman.o timeman.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o tt.o tt.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o uci.o uci.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o ucioption.o ucioption.cpp g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -DANTI -DATOMIC -DBUGHOUSE -DCRAZYHOUSE -DHORDE -DKOTH -DLOOP -DLOSERS -DRACE -DSUICIDE -DTHREECHECK -DUSELONGESTPV -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -c -o syzygy/tbprobe.o syzygy/tbprobe.cpp g++ -o stockfish benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o material.o misc.o movegen.o movepick.o pawns.o position.o psqt.o search.o thread.o timeman.o tt.o uci.o ucioption.o syzygy/tbprobe.o -static make[1]: Leaving directory '/home/lanto/crazy'

ddugovic commented 7 years ago

Thanks, it makes sense to have an issue for this.

lantonov commented 7 years ago

Thank you for the quick reaction. Now it compiles cleanly.

ddugovic commented 7 years ago

Thanks for reporting this! 👍