🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3217

Re: gcc and NULL function pointers.

#3217
From: Peter da Silva
Date: Thu, 27 Jun 1991 14:00
18 lines
1276 bytes
In article <1991Jun27.011959.14714@ringer.cs.utsa.edu> djimenez@ringer.cs.utsa.edu (Daniel Jimenez) writes:
> #define NULL(type) (type*)0 /* no, I didn't make it up.  I stole it. */

I use

#define NIL(t) ((t)0) /* sometimes lowercase on older code */

That way it won't confuse people (what's this NULL with an argument?), and
you can use typedeffed pointers or macros in there:

typedef void (*funptr)();

	if(fun == NIL(funptr)) ...

And I don't think it's a silly idea.
-- 
Peter da Silva; Ferranti International Controls Corporation; +1 713 274 5180;
Sugar Land, TX  77487-5012;         `-_-' "Have you hugged your wolf, today?"
Technical Details
Message-ID: <-B7CP53@xds13.ferranti.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!usc!rpi!zaphod.mps.ohio-state.edu!menudo.uh.edu!sugar!ficc!peter
References: <XZ4C6T6@xds13.ferranti.com> <1991Jun26.053508.3634@ringer.cs.utsa.edu> <1991Jun26.134355.29334@cs.odu.edu> <1991Jun27.011959.14714@ringer.cs.utsa.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!usc!rpi!zaphod.mps.ohio-state.edu!menudo.uh.edu!sugar!ficc!peter
From: peter@ficc.ferranti.com (Peter da Silva)
Newsgroups: comp.std.c
Subject: Re: gcc and NULL function pointers.
Keywords: :-)
Message-ID: <-B7CP53@xds13.ferranti.com>
Date: 27 Jun 91 14:00:39 GMT
References: <XZ4C6T6@xds13.ferranti.com> <1991Jun26.053508.3634@ringer.cs.utsa.edu> <1991Jun26.134355.29334@cs.odu.edu> <1991Jun27.011959.14714@ringer.cs.utsa.edu>
Reply-To: peter@ficc.ferranti.com (Peter da Silva)
Organization: Xenix Support, FICC
Lines: 18