[Gambas-bugtracker] Bug #2667: CShort in GambasSelfTest fails

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Tue Dec 20 01:59:27 CET 2022


Comment #2 by Benoît MINISINI:

The test was actually wrong from the start, because as Gambas is written in C, converting 100000 to a signed short integer is undefined according to the C standard. It usually returns -31072, but this is not a guarantee. So it's far better to raise an overflow instead of relying of an undefined behaviour.

More information about the Bugtracker mailing list