Casting call

VLD/VMB gwyn at Brl.ARPA
Thu May 23 22:26:08 AEST 1985


>> #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.



More information about the Comp.lang.c mailing list