Newsgroups: comp.std.c++
Path: utzoo!henry
From: henry@zoo.toronto.edu (Henry Spencer)
Subject: Re: null references & dereferencing null pointers
Message-ID: <1990Aug1.170554.21854@zoo.toronto.edu>
Organization: U of Toronto Zoology
References: <56159@microsoft.UUCP> <RLS.90Jul31125458@onondaga.steinmetz.ge.com>
Date: Wed, 1 Aug 90 17:05:54 GMT

In article <RLS.90Jul31125458@onondaga.steinmetz.ge.com> rls@onondaga.steinmetz.ge.com (Rod Sprattling) writes:
>
>One use for dereferencing null pointers leaps to mind.  Consider this
>definition, used in Intrinsics-based widgets in the X Window System:
>
>#define XtOffset(type,field) \	 ...

The correct way to deal with this is with ANSI C's `offsetof' macro,
which can do whatever magic is necessary in a particular implementation.

That is, there is no need to invent a solution -- e.g. allowing null
dereferencing -- for this problem, it has already been solved.
-- 
The 486 is to a modern CPU as a Jules  | Henry Spencer at U of Toronto Zoology
Verne reprint is to a modern SF novel. |  henry@zoo.toronto.edu   utzoo!henry
