Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!spool.mu.edu!mips!swrinde!zaphod.mps.ohio-state.edu!think.com!yale.edu!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: gcc and NULL function pointers. Message-ID: <16481@smoke.brl.mil> Date: 22 Jun 91 04:37:24 GMT References: <16468@smoke.brl.mil> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 16 In article peter@ficc.ferranti.com (Peter da Silva) writes: >> What about systems where different pointer types have different sizes? >Then a different definition of NULL is appropriate. NO NO NO. There is NO appropriate definition of NULL if your criterion be that it "work" without proper casting. If you declare it as, say, something that will work as an int*, then it cannot work as a char* on a system where different pointer types have different sizes. In other words, the problem you think you're trying to solve cannot be solved in general. As I said, you do nobody a favor when you make the programmer think that he doesn't need to be careful (because your implementation will "fix" his sloppiness). All this stuff was thoroughly discussed in X3J11, by the way. The outcome was what you now see specified in the C standard.