gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] logitech lib problems


From: Gaius Mulley
Subject: Re: [Gm2] logitech lib problems
Date: 08 Sep 2005 11:22:38 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

John B Wallace Jr <address@hidden> writes:

> I encountered two problems with the logitech libraries:
> 
> 1. The logitech libraries are installed but not compiled (no object files).
> 
> 2. The WriteLongInt procedure in the LongIO module seems to have a problem
>    with MIN(LONGINT). The code below demonstrates the problem:
> 
> I get this output on my system:
> 
> 9223372036854775807
> -922337203685477580-8
> -9223372036854775807
> 

Hi John and fellow gm2 people,

thanks for the reports, I've fixed the bug in
gm2/gm2-libs/StringConvert.mod. However the bug has raised an
important question, namely that of DIV, MOD with negative values.

I'm sure this has been documented elsewhere, numerous times, but this
is the first time I've been bitten by this bug feature :-) Basically
it appears that:


        -31 DIV 10     -31 MOD 10

PIM2     -3            undefined    P24 of PIM2
PIM3     -3            undefined    P27 of PIM3
PIM4     -4            9            P29 of PIM4
ISO      -4            9            P201 of ISO


I propose that the compile time -Wpim2, -Wpim3, -Wpim4, -Wiso switches
effect code generation to comply with the table above. And introducing
-Wmodulus (or suitable name) which generates a runtime warning about
negative modulus operands for PIM2 and PIM3. Is this generally
acceptable?

It does mean we have to be careful which switches we use when are
compiling legacy code. I guess the default behaviour should map onto
PIM4 and ISO. Again has anyone strong opinions about this?

Thanks Gaius



reply via email to

[Prev in Thread] Current Thread [Next in Thread]