Hello Jim,

I think yes. It's a complete game - and since I've been playing *a lot of
it* in the last two weeks, I'm pretty sure it's bug-free. Let's include it
in FreeDOS 1.3.

While trying to get Senet to build with gcc-ia16 + libi86, I came across
a bit of a gremlin in the Senet code:

for (sq = 0; (board[sq] != player) && (sq < 30); sq++); /* empty loop */

with the `sq < 30' check coming after the `board[sq] != player' check.
The problem was triggered only under gcc-ia16, not Open Watcom.


Specifically, under gcc with optimization (e.g. -Os), the compiler
determined that `board[sq]' with sq >= 30 would be "undefined
behaviour".  Because of this, it decided to elide out the entire "You
have moved all your pieces off the board" check.  (And unfortunately, it
did not give any warning diagnostic.)  The result was that senet.exe
would never ever declare a winner.

Thank you!

--
https://gitlab.com/tkchia :: https://github.com/tkchia


_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to