Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 8/23/84; site ucbcad.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!mcnc!decvax!ucbvax!ucbcad!faustus From: faustus@ucbcad.UUCP (Wayne A. Christopher) Newsgroups: net.lang.c Subject: Re: Re: Casting call Message-ID: <4@ucbcad.UUCP> Date: Fri, 24-May-85 03:22:46 EDT Article-I.D.: ucbcad.4 Posted: Fri May 24 03:22:46 1985 Date-Received: Sun, 26-May-85 00:42:25 EDT References: <10946@brl-tgr.ARPA> Organization: UC Berkeley CAD Group, Berkeley, CA Lines: 15 > >> #define FREE(ptr) { free((char *) ptr); ptr = (typeof ptr) NULL; } > > > ... If we were using ANSI C, ... > > One doesn't even need any of the new ANSI C features: > > #define FREE( ptr ) ( free( (char *)ptr ), ptr = NULL ) > > since one can always assign 0 (NULL) to any pointer type. The original problem was that NULL is a valid address under 4.{2,3}, but (char *) -1 isn't. This is, of course, dependent on 4.2 and the VAX. Wayne