Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site harvard.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!breuel From: breuel@harvard.ARPA (Thomas M. Breuel) Newsgroups: net.lang.c Subject: Re: limitations of cast, pointers, &c... Message-ID: <124@harvard.ARPA> Date: Thu, 1-Nov-84 08:52:47 EST Article-I.D.: harvard.124 Posted: Thu Nov 1 08:52:47 1984 Date-Received: Sat, 3-Nov-84 01:50:54 EST Distribution: net Organization: Aiken Computation Laboratory, Harvard Lines: 23 Thanks for your replies. Casting the lhs of an assignment might be defined in an unambiguous way as, for example: (type)x = y; <=> *(type *)&x = y; which would be useful and unambiguous, but different in meaning from a cast as it is usually used. It might also be defined as: (ytype)x = y; <=> x = (xtype)y; where xtype and ytype refer to the types of x and y respectively, and where the construct is undefined if the cast on the lhs is not to the type of the expression on the rhs. In a similar manner it would also be possible to fill 'typedef ref *ref;' with meaning. At any rate, replacing the dereferencing operator '*' by '#define deref(x) *(ref *)x' gives the type 'ref' the desired properties and thereby solves my problem. Yours sincerely, Thomas. (breuel@harvard.arpa)