Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several warnings while compiling with MingW in Windows. #3

Closed
hero2017 opened this issue Sep 11, 2016 · 3 comments
Closed

Several warnings while compiling with MingW in Windows. #3

hero2017 opened this issue Sep 11, 2016 · 3 comments

Comments

@hero2017
Copy link

hero2017 commented Sep 11, 2016

I've been seeing these regularly with all the cFish updates I've tried so far, even before Numa. It compiles without error and doesn't seem to affect the engine's performance but perhaps it can lead to other problems? Tried several different versions of gcc. Compiling with MingW, and currently using gcc 6.2.0 on Win'2008 R2 Ent. and 2x E5-2696v3 . And as I mentioned before, LP doesn't work as well. I hope this helps.

.....
gcc -Wall -std=c11 -fprofile-generate -Wextra -Wshadow -DNDEBUG -O3 -DIS_64BIT -
msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -DNUMA -c -o position.o po
sition.c
position.c: In function 'print_pos':
position.c:127:31: warning: unknown conversion type character 'l' in format [-Wf
ormat=]
printf("\nFen: %s\nKey: %16llX\nCheckers: ",
^
position.c:127:10: warning: too many arguments for format [-Wformat-extra-args]
printf("\nFen: %s\nKey: %16llX\nCheckers: ",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
position.c:127:31: warning: unknown conversion type character 'l' in format [-Wf
ormat=]
printf("\nFen: %s\nKey: %16llX\nCheckers: ",
^
position.c:127:10: warning: too many arguments for format [-Wformat-extra-args]
printf("\nFen: %s\nKey: %16llX\nCheckers: ",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -Wall -std=c11 -fprofile-generate -Wextra -Wshadow -DNDEBUG -O3 -DIS_64BIT -
msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -DNUMA -c -o psqt.o psqt.c

gcc -Wall -std=c11 -fprofile-generate -Wextra -Wshadow -DNDEBUG -O3 -DIS_64BIT -
msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -DNUMA -c -o search.o sear
ch.c
search.c: In function 'search_clear':
search.c:219:22: warning: format '%ld' expects argument of type 'long int', but
argument 2 has type 'long long unsigned int' [-Wformat=]
printf("sizeof = %ld\n", sizeof(*cmh_tables[0]));
^
search.c:219:22: warning: format '%ld' expects argument of type 'long int', but
argument 2 has type 'long long unsigned int' [-Wformat=]
gcc -Wall -std=c11 -fprofile-generate -Wextra -Wshadow -DNDEBUG -O3 -DIS_64BIT -
msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -mbmi2 -DNUMA -c -o tbprobe.o tbp
robe.c
tbprobe.c: In function 'probe_wdl_table':
tbprobe.c:160:10: warning: array subscript is above array bounds [-Warray-bounds
]
p[i++] = pop_lsb(&bb) ^ mirror;
~^~~~~
tbprobe.c: In function 'TB_probe_dtz':
tbprobe.c:270:10: warning: array subscript is above array bounds [-Warray-bounds
]
p[i++] = pop_lsb(&bb) ^ mirror;
.....

In all fairness I also see some warnings when running a Stockfish Run test where it downloads and compiles a test run:

Running lmrk3b vs master:
.....
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -fprofile-generate -W
extra -Wshadow -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -c -
o syzygy/tbprobe.o syzygy/tbprobe.cpp
syzygy/tbprobe.cpp: In function 'int probe_ab(Position&, int, int, int_)':
syzygy/tbprobe.cpp:205:14: warning: array subscript is above array bounds [-Warr
ay-bounds]
p[i++] = pop_lsb(&bb) ^ mirror;
~~~~~^
syzygy/tbprobe.cpp: In function 'int Tablebases::probe_dtz(Position&, int_)':
syzygy/tbprobe.cpp:315:14: warning: array subscript is above array bounds [-Warr
ay-bounds]
p[i++] = pop_lsb(&bb) ^ mirror;
~~~~~^
g++ -o stockfish benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o ma
terial.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 -lgcov -static

.....

@hero2017 hero2017 changed the title Lots of warnings during compiling in Windows. Several warnings during compiling in Windows. Sep 11, 2016
@hero2017 hero2017 changed the title Several warnings during compiling in Windows. Several warnings while compiling with MingW in Windows. Sep 11, 2016
@syzygy1
Copy link
Owner

syzygy1 commented Sep 11, 2016

LP does not work yet "by design". I will fix this soon.
The warnings are harmless but a bit annoying. Some of them seem to be incorrectly reported by MingW. Maybe I'll just disable the -Wformat warnings in the Makefile. The array subscript warnings are incorrectly generated by gcc since gcc-4.8.

@hero2017
Copy link
Author

hero2017 commented Sep 11, 2016

Thank you for the response. I'll wait and look forward to the fixes and let you know of any other problems if that's ok. Good job on Numa. Love it!

@MichaelB7
Copy link

You can use "-Wno-array-bounds" for the gcc-4.8 array subscript warning.

@syzygy1 syzygy1 closed this as completed Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants