Invalid Pointers

Leslie Mikesell les at chinet.chi.il.us
Tue Jul 18 13:55:55 AEST 1989


In article <10541 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:

>-#define NO_FOOBAR ((struct foobar *) -1 )	is what I use, but...

>This is not portable.  Just use NULL.

Do you mean that there are machines that might return a valid -1 from
sbrk(2) or shmat(2), or that would misconstrue the comparsion of
a pointer to -1?  Yes, I know these are botches, but are they not
always accomodated?

Les Mikesell



More information about the Comp.lang.c mailing list