c - Strange bug when compiling on 32bit -
i cannot reduce issue small test case. please git clone
code here: https://github.com/tm1rbrt/chess.git commit b3055a45c28978b4a364 (head @ time of writing) or browse code here: https://github.com/tm1rbrt/chess
on line 119 of gametree.c have line
//score -= 1; // line breaks things!
if uncomment break stuff seems in no way related it. happens when subtract or add negative number score variable.
this wasnt issue when building on 64bit windows machine. on 32bit one. both outputting 32bit executable think.
i have no idea why happen, can guess todo different size ints or something. know longshot if shed light grateful.
edit
i set magic variable not_evaluated
0xffffffff rather intmax when score unsigned int. causing issue. (when changed score signed int)
what mean "will break stuff"? if it's crashing, you're using (whether planned, or accident) part of index / pointer makes write unallocated space.
use tools valgrind or other overflow/underflow checker verify if case.
if want more detailed answer, grab debugger , define fails , in way (what exact scenario / stacktrace / value of score @ point)
Comments
Post a Comment