gcc and NULL function pointers.

Peter da Silva peter at ficc.ferranti.com
Fri Jun 28 00:00:39 AEST 1991


In article <1991Jun27.011959.14714 at ringer.cs.utsa.edu> djimenez at 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?"



More information about the Comp.std.c mailing list