Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!ll-xn!ames!oliveb!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: comp.lang.c Subject: Re: NULL function pointers Message-ID: <27949@sun.uucp> Date: Mon, 14-Sep-87 17:10:31 EDT Article-I.D.: sun.27949 Posted: Mon Sep 14 17:10:31 1987 Date-Received: Wed, 16-Sep-87 01:36:07 EDT References: <9268@brl-adm.ARPA> Organization: Sun Microsystems, Inc. - Mtn View, CA Lines: 18 > K&R guarantees pointers to valid data objects are non-NULL. But what > about function pointers? I found no reference to guarantees to non-NULL > function pointers and a number of compiler system/linkers I've seen have > no problem inserting C functions at address 0. The passage in question says "object", not "data object", and only a cad of an implementor would interpret "object" as meaning "data object" here. (Of course, it is quite possible that some C implementors *are* cads; the existence of systems that do not ensure that no function has an address that compares equal to a null pointer would suggest that some are....) The latest ANSI C draft says "object or function" in its discussion of null pointers, thus restraining the aforementioned implementors and ensuring that C implementations are sane in this regard. -- Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com (or guy@sun.arpa)