Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!agate!ucbvax!ulysses!smb From: smb@ulysses.homer.nj.att.com (Steven M. Bellovin) Newsgroups: comp.unix.wizards Subject: Re: Referencing NULL pointers Message-ID: <11773@ulysses.homer.nj.att.com> Date: 10 Jul 89 09:05:45 GMT References: <19367@paris.ics.uci.edu> Organization: AT&T Bell Laboratories, Murray Hill Lines: 11 In article <19367@paris.ics.uci.edu>, hadley@ics.uci.edu (T.S. Hadley) writes: > By NULL pointer referencing I mean: consider the C frags: > ... > TYPE *t = (TYPE *) 0; /* typedef struct { ... } TYPE; */ > if(t->field == 0) > ... NULL pointer dereferencing (the correct term, btw) is illegal. That it works on some machines is coincidental. I regard the segmentation fault on the Suns as a useful feature of their implementation of the system, as it catches bugs as shown above.