[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SYSTEM.VAL Invalid use
> Date: Fri, 12 Apr 96 06:08:00 EDT
> From: Mike Griebling <grieblm@trt.allied.com>
>
> In compiling some ETH code I'm finding that they are using SYSTEM.VAL in
> places where O2C doesn't allow. For example, they say:
>
> INC(SYSTEM.VAL(LONGINT, tag), 4)
>
> where tag is a pointer type. Does O2C restrict the arguments allowable in
> the INC procedure arbitrarily or is there some reason for this restriction?
Seems like your particular ETH compiler and o2c disagree on the
interpretation of the language report.
In 10.3 it says that the first operand of INC has to be a variable.
And in App C SYSTEM.VAL is introduced as a function procedure. IMO
applying VAL to a designator results into an expression, and not another
variable.
Implementing this non-function VAL would also require some strange
twisting of the o2c code generation. Currently its code generator
would turn the above expression into something along the lines of
(LONGINT)tag = (LONGINT)tag+4
I haven't checked it, but I think that C doesn't like a cast on an
lvalue at all.
In short: I don't see any reason to adopt the strange (or rather
illegal?) interpretation of VAL your compiler uses. I don't read the
report this way, and implementing it wouldn't be trivial.
-- mva