Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!xanth!mcnc!decvax!ima!cfisun!lakart!dg From: dg@lakart.UUCP (David Goodenough) Newsgroups: comp.unix.wizards Subject: Re: Referencing NULL pointers Message-ID: <613@lakart.UUCP> Date: 11 Jul 89 15:55:55 GMT References: <19367@paris.ics.uci.edu> Organization: Lakart Corporation, Newton, MA Lines: 24 From article <19367@paris.ics.uci.edu>, by hadley@ics.uci.edu (T.S. Hadley): > By NULL pointer referencing I mean: consider the C frags: > > char *s = (char *) 0, t[10]; > strcpy(t, s); > > On my machine (sun) these statements causes segmentation violations > during runtime. > > Apparantly, on other machines this is perfectly valid, since I see > quite a lot of this in code created on certain non-sun machines. Just remember one of the 10 commandments: Thou shalt not follow the NULL pointer, for surely chaos and madness await thee at it's end. Your sun burps if you try it. Well good for it - I wish my CP/M box at home would do so (however int i; i = *((int *) 1); does have it's uses :-) ) -- dg@lakart.UUCP - David Goodenough +---+ IHS | +-+-+ ....... !harvard!xait!lakart!dg +-+-+ | AKA: dg%lakart.uucp@xait.xerox.com +---+