Casting Pointers - (nf)

pedz at smu.UUCP pedz at smu.UUCP
Sun Feb 12 19:57:23 AEST 1984


#R:houxt:-35400:smu:13800002:000:672
smu!pedz    Feb 11 18:49:00 1984

I am suprised at how long this note has been around without the
original question being answered.  That question being which compiler
is correct.  

On page 214 of K&R it states that an lvalue may be a list of items,
however it may not be a type casted item.  Since an lvalue must be on
the left side of an assignment statement, this makes the statement
illegal.  Thus the 68000 compiler is "incorrect" in accepting the
syntax.  

This only makes sense becuase the result of a type cast could easily
be a temporay value on the stack or in a register.  The fact that the
technique is highly system dependant is also a good reason to make it
illegal.

Perry
parsec!smu!pedz



More information about the Comp.lang.c mailing list