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

GCC: Warnings with syzygy #196

Closed
mcostalba opened this issue Jan 10, 2015 · 16 comments
Closed

GCC: Warnings with syzygy #196

mcostalba opened this issue Jan 10, 2015 · 16 comments

Comments

@mcostalba
Copy link

I have this warnings when building with gcc

syzygy/tbprobe.cpp: In function ‘int probe_ab(Position&, int, int, int_)’:
syzygy/tbprobe.cpp:204:14: warning: array subscript is above array bounds [-Warray-bounds]
p[i++] = pop_lsb(&bb) ^ mirror;
^
syzygy/tbprobe.cpp:204:14: warning: array subscript is above array bounds [-Warray-bounds]
syzygy/tbprobe.cpp: In function ‘int Tablebases::probe_dtz(Position&, int_)’:
syzygy/tbprobe.cpp:314:14: warning: array subscript is above array bounds [-Warray-bounds]
p[i++] = pop_lsb(&bb) ^ mirror;
^
syzygy/tbprobe.cpp:314:14: warning: array subscript is above array bounds [-Warray-bounds]

@glinscott
Copy link
Contributor

Which compiler?

@matthewlai
Copy link

I also get that.

Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix

@mcostalba
Copy link
Author

gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)

On Sat, Jan 10, 2015 at 7:05 PM, Gary Linscott notifications@github.com
wrote:

Which compiler?


Reply to this email directly or view it on GitHub
#196 (comment)
.

@joergoster
Copy link
Contributor

I only get that when compiling with debug=yes.
gcc version 4.9.2 (Ubuntu 4.9.2-0ubuntu1~14.04)

@zamar
Copy link

zamar commented Jan 13, 2015

gcc is known to suffer from false positives in this area... especially with -O3

@zamar
Copy link

zamar commented Jan 14, 2015

@mcostalba
Copy link
Author

Thanks for the link. Sadly it seems they simply don't care (after a failed
first attempt) to fix it.

On Wed, Jan 14, 2015 at 9:09 AM, Joona Kiiski notifications@github.com
wrote:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273


Reply to this email directly or view it on GitHub
#196 (comment)
.

@zamar
Copy link

zamar commented Jan 18, 2015

Ignore for SF6.

syzygy implementation will be worked on during SF7 anyway.

@zamar
Copy link

zamar commented Feb 7, 2015

Good news. They have fixed the bug in the gcc5 branch :)

@zamar zamar changed the title Warnings with syzygy GCC < 5: Warnings with syzygy Jan 21, 2016
@Kingdefender
Copy link

Hi all,

This just for the record, I have recently installed the latest MinGW and, as reported by Felix on FishCooking also, it seems the issue is not fixed/back again, at least with current Stockfish master, you get the same warning. My version of GCC:
C:>GCC --version
GCC (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.

Eelco

@zamar zamar changed the title GCC < 5: Warnings with syzygy GCC: Warnings with syzygy Apr 13, 2016
@zamar
Copy link

zamar commented Apr 13, 2016

Still unfixed gcc bug:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124

@vondele
Copy link
Member

vondele commented Nov 6, 2016

this issue can now be closed.

What about making gcc's -Werror (all warnings are error) part of the makefile now ?

@lantonov
Copy link

lantonov commented Nov 6, 2016

With Marco's syzygy rewrite and gcc-6.1.0 I no longer get this warning

@mcostalba
Copy link
Author

Fixed by c0bb0415394179e9c771

@mstembera
Copy link
Contributor

I get these warnings under MSVC w/ the new C++ syzygy implementation.
tbprobe.cpp(536): warning C4267: 'initializing': conversion from 'size_t' to 'uint32_t', possible loss of data
tbprobe.cpp(547): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
tbprobe.cpp(582): warning C4244: '=': conversion from 'uint64_t' to '`anonymous-namespace'::Sym', possible loss of data
tbprobe.cpp(983): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
tbprobe.cpp(1010): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data

@mcostalba
Copy link
Author

Thanks for reporting. I knew them also by looking at Travis ci output after
each commit.

I don't plan to fix them because they are wrong (gcc and clang don't report
them) and the fix if is a bunch of casts it is very ugly too.

If you are able to fix them without using casts then it's ok.

On Tuesday, November 8, 2016, mstembera notifications@github.com wrote:

I get these warnings under MSVC w/ the new C++ syzygy implementation.
tbprobe.cpp(536): warning C4267: 'initializing': conversion from 'size_t'
to 'uint32_t', possible loss of data
tbprobe.cpp(547): warning C4267: 'initializing': conversion from 'size_t'
to 'int', possible loss of data
tbprobe.cpp(582): warning C4244: '=': conversion from 'uint64_t' to
'`anonymous-namespace'::Sym', possible loss of data
tbprobe.cpp(983): warning C4267: '=': conversion from 'size_t' to 'int',
possible loss of data
tbprobe.cpp(1010): warning C4267: 'initializing': conversion from 'size_t'
to 'int', possible loss of data


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#196 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABDGASjhs1J8vesjNkeKpQtkvVy_an7Zks5q8M1JgaJpZM4DQuIH
.

MichaelB7 pushed a commit to MichaelB7/Stockfish that referenced this issue Apr 23, 2020
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

9 participants