Path: 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: <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 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?"