call to revolt

Norman Diamond diamond at jit533.swstokyo.dec.com
Thu Jun 27 10:24:12 AEST 1991


In article <992 at baby.and.nl> jos at and.nl (J. Horsmeier) writes:

>Hi there, I'll die if casting lvals is going to be illegal.

Well, you can cast an lval, but the result is not an lval.  I guess you
mean you'll die if the result of a cast isn't an lval.  I guess you've been
dead ever since casts were added to C, around 1978, except for brief intervals
on some BSD-based compilers.

>type* Thing;
>((int)Thing)= Thing-Base+1;

You'll die if you have to write
  Thing = (type*) (Thing-Base+1);
My heart bleeds for you.

Incidentally, your code would fail if int is smaller than pointers to "type,"
for example if int is 32 bits and pointers are 48 bits.  My suggestion would
fail if the implementation is excessively perverse, but not due to reasonable
hardware architectures.
--
Norman Diamond       diamond at tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.
Permission is granted to feel this signature, but not to look at it.



More information about the Comp.std.c mailing list