Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site bbncc5.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!bbnccv!bbncc5!keesan From: keesan@bbncc5.UUCP (Morris M. Keesan) Newsgroups: net.lang.c Subject: Re: NULL ROUTINE POINTERS Message-ID: <182@bbncc5.UUCP> Date: Mon, 2-Dec-85 16:12:38 EST Article-I.D.: bbncc5.182 Posted: Mon Dec 2 16:12:38 1985 Date-Received: Thu, 5-Dec-85 05:20:15 EST References: <139@brl-tgr.ARPA> Reply-To: keesan@bbncc5.UUCP (Morris M. Keesan) Organization: Bolt Beranek and Newman, Cambridge, MA Lines: 13 Keywords: typedef Summary: use typedefs The request was for a way to specify a null pointer to a function returning short. Doug Gwyn correctly responded with ((short (*)()) 0). Note that the form of the type specification is copied directly from section 8.7 of the C Reference Manual in K&R (page 200), and therefore very safe. For real readability, I as usual suggest the typedef method: typedef short FS(); /* FS = Function returning Short */ typedef FS *PFS; /* PFS = Pointer to Function returning Short */ #define NULLROUTINE ((PFS)0) /* Isn't this much clearer? */ -- Morris M. Keesan keesan@bbn-unix.ARPA {decvax,ihnp4,etc.}!bbncca!keesan