gcc and NULL function pointers.

Doug Gwyn gwyn at smoke.brl.mil
Sun Jun 23 09:13:44 AEST 1991


In article <1146.Jun2221.20.2291 at kramden.acf.nyu.edu> brnstnd at 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.



More information about the Comp.std.c mailing list