tryingsomestuff / Minic

A simple chess engine to learn and play with
GNU General Public License v3.0
97 stars 12 forks source link

raspberry pi compile errors with latest code #9

Closed ScallyBag closed 4 years ago

ScallyBag commented 4 years ago

Hi,

Since your recent updates I’m getting errors whilst compiling your engine:

Source/position.hpp:26:50: error: braces around scalar initializer for type ‘BitBoard {aka long long unsigned int}’ BitBoard allPieces[2] {{empty}}; ^ compilation terminated due to -Wfatal-errors.

Changing {{empty}}; to {empty} fixes it for me.

Thanks,

Al.

tryingsomestuff commented 4 years ago

Thanks for reporting. It is difficult to satisfy all compilers on this subject ! I suggest to simply turn that errors to warning playing with your options (-Werror=braced-scalar-init, -Werror=many-braces-around-scalar-init, and so on). Are you using your own build script or the one given ?

ScallyBag commented 4 years ago

Hi,

I’m using your build script ....

Al.

tryingsomestuff commented 4 years ago

What compiler are you using please ? (version number)

tryingsomestuff commented 4 years ago

Looks like a g++<9 issue (https://godbolt.org/z/SF8Dqi) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88572 I'll try to help older compilers anyway.

ScallyBag commented 4 years ago

Hi,

My default is g++-6.3.0 but I’ve also tried g++-8.3.0 I can also use g++-7.2.0, g++-8.1.0 and g++-8.2.0 My attempt at g++-9.1.0 doesn’t work

Al.

tryingsomestuff commented 4 years ago

ok, i've just update master, can you retry please ?

ScallyBag commented 4 years ago

Hi,

Yes that’s working fine now.

I had knocked up a bash file to change the double curly brackets to singles, but you’ve done a lot more than that.

Thanks very much,

Al.

tryingsomestuff commented 4 years ago

Well, thank you for using Minic ;-)