Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!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: <16468@smoke.brl.mil> Date: 20 Jun 91 15:42:38 GMT References: <16418@smoke.brl.mil> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 15 In article peter@ficc.ferranti.com (Peter da Silva) writes: >Oh, I know it's incorrect. It's also common enough that a compiler vendor >on a system where 0 doesn't have the same size and bit pattern as (void *)0 >would be foolish to #define NULL as 0 in . >Yes, it's better that everyone write correct code. But be liberal with >what you accept... after all, the person you're punishing with a B&D >definition of NULL is your customer. You're NOT doing your customer any favor by catering to his misconceptions. What about systems where different pointer types have different sizes? There is no way the implementation can fully compensate for the programmer having incorrectly coded his use of the NULL macro, and by trying to accommodate such abuse at all you're merely reinforcing the mistaken notion that caused the programmer to make the mistake in the first place. Sooner or later it is going to catch up with him, and the sooner the better.