mhouppin / stash-bot

Mirror of my Gitlab chess engine project.
GNU General Public License v3.0
57 stars 6 forks source link

Compilation error on mingw #117

Closed cj5716 closed 1 year ago

cj5716 commented 1 year ago
cc -Wall -Wextra -Wcast-qual -Wshadow -Werror -O3 -flto -DUSE_PREFETCH -DUSE_POPCNT -msse -msse3 -mpopcnt -MMD -I include  -c -o sources/bench.o sources/bench.c
cc -Wall -Wextra -Wcast-qual -Wshadow -Werror -O3 -flto -DUSE_PREFETCH -DUSE_POPCNT -msse -msse3 -mpopcnt -MMD -I include  -c -o sources/bitboard.o sources/bitboard.c
cc -Wall -Wextra -Wcast-qual -Wshadow -Werror -O3 -flto -DUSE_PREFETCH -DUSE_POPCNT -msse -msse3 -mpopcnt -MMD -I include  -c -o sources/board.o sources/board.c
In file included from sources/board.c:24:
sources/board.c: In function ‘board_parse_castling’:
sources/board.c:290:41: error: array subscript has type ‘char’ [-Werror=char-subscripts]
  290 |         const color_t side = islower(fen[i]) ? BLACK : WHITE;
      |                                      ~~~^~~
cc1: all warnings being treated as errors
make: *** [<builtin>: sources/board.o] Error 1

version: latest dev

mhouppin commented 1 year ago

Thanks for reporting this. Could you please paste here the output of cc -v and cc --version on your PC ? That's a really strange error considering that the subscript (the variable i in this case) is a size_t, not a char, and that Stash builds fine with both gcc and clang on my machine, so I'm trying to pinpoint if it's linked to some weird Windows-only issue, or to a specific compiler version.