Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site rlgvax.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!rlgvax!guy From: guy@rlgvax.UUCP (Guy Harris) Newsgroups: net.lang.c Subject: Re: offsets in structures. Message-ID: <211@rlgvax.UUCP> Date: Sat, 20-Oct-84 03:09:53 EDT Article-I.D.: rlgvax.211 Posted: Sat Oct 20 03:09:53 1984 Date-Received: Mon, 22-Oct-84 15:33:50 EDT References: <393@orion.UUCP> <5172@brl-tgr.ARPA>, <6542@mordor.UUCP> Organization: CCI Office Systems Group, Reston, VA Lines: 21 > What more does using special "nil" get you than using a 0, apart from > hardware check against dereferencing NULL? In any case, the hardware > check is unnecessary if you write your code correctly. Are we all > hackers or are there some professional programmers out there? Assuming you are handed an existing machine and an existing OS, libraries, and language tools with hardware and/or software conventions assigning a non-zero value to a null pointer, it gets you compatibility between a C implementation done for that machine and the other languages on that machine. If the hardware check is already there, one might as well use it. There's plenty of crap code out there - in standard versions of UNIX - that *does* dereference null pointers; hardware/software that catches it can help flush it out. We discovered this in our port to our 68000-based micro, which shoots down null pointer dereferences for reasons other than checking code. Also note that even the best programmers do not produce 100% perfect code every time; no amount of methodology or care can eliminate all errors, as the programmer could easily err in applying their checks as easily as they err in producing code. Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy