Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!att!rutgers!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: gcc and NULL function pointers. Message-ID: <16506@smoke.brl.mil> Date: 22 Jun 91 23:13:44 GMT References: <9752@cognos.UUCP> <25572@well.sf.ca.us> <1146.Jun2221.20.2291@kramden.acf.nyu.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 12 In article <1146.Jun2221.20.2291@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: >I'm not sure what people are arguing here. Yes, programmers should >always cast NULL appropriately if they use it at all, because there >exist vendors which #define NULL 0. Yes, vendors should define NULL as >((char *) 0) or ((void *) 0), because there exist programmers who use >NULL without casting and it's better to detect such misuse. What's the >issue? The issue is that #defining NULL as ((void*)0) does NOT detect such misuse, nor does it adequately compensate for it in all cases. #defining NULL as ((char*)0) is simply wrong.