gm2
[Top][All Lists]
Advanced

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

[Gm2] Adress arithmetic


From: Waldek Hebisch
Subject: [Gm2] Adress arithmetic
Date: Fri, 26 Mar 2004 02:17:26 +0100 (CET)

I just found out that gm2 rejects substraction of two expressions
of type ADDRESS. It looks like a bug to me to accept pointer addition
but reject substraction -- I do not know what ISO says but my copy
(translation) of PM2 says that any address arithmetic is valid. The
program below:

MODULE ttp;
FROM SYSTEM IMPORT ADDRESS;
VAR x, y : ADDRESS;
    i : CARDINAL;
BEGIN
  i := CARDINAL(x - y);
END ttp
.

gives me:
src1$ ../../gm2-lin/gcc/xgm2 -B../../gm2-lin/gcc/ -c -I. 
-I../../gcc-3.3.2/gcc/gm2/gm2-libs ttp.mod
ttp.mod: In function `_M2_ttp_init':
ttp.mod:5: error: invalid operands to binary -

If I change `-' to `+' the program compiles OK. By the way, this is an
extact from bigger program. In the bigger program line numbers in 
error messages are off quite a bit.
 
-- 
                              Waldek Hebisch
address@hidden 



reply via email to

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