[Gambas-user] Possible error when doing math on bytes

Brian G brian at westwoodsvcs.com
Tue Jan 3 23:45:57 CET 2023


A lot of my applications no longer run,

And bad new, it reports error even if fast unsafe in my apps

How do i just turn this off permanently, It is very bad news!


"Failure is the key to success; 
 each mistake teaches us something"  .. Morihei Ueshiba
Brian G

----- On Jan 3, 2023, at 2:40 PM, Benoit Minisini benoit.minisini at gambas-basic.org wrote:

> Le 03/01/2023 à 23:08, Brian G a écrit :
>> When I do math on bytes I get an overflow now when  the value of the
>> byte goes negative
>> example:
>>   dim a as byte = 0
>>   dim b as byte = 24
>>   dim result as byte = a - b
>> 
>> This causes an overflow error, where in the past it was just a negative
>> number.
>> Is this a bug or a new undocumented feature?
>> 
> 
> Overflows were ignored before, as it is usually the case in C programs,
> even if the behaviour of overflows is unspecified. It's for speed
> reasons, or to make hacking easier, I dunno.
> 
> So I decided to detect them, for a small performance penalty.
> 
> The overflow checks are only disabled on 'Fast Unsafe' functions.
> 
> Regards,
> 
> --
> Benoît Minisini.
> 
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----


More information about the User mailing list