gcc and NULL function pointers.

Peter da Silva peter at ficc.ferranti.com
Thu Jun 20 06:34:11 AEST 1991


In article <16418 at smoke.brl.mil> gwyn at smoke.brl.mil (Doug Gwyn) writes:
> In article <EE-B=O2 at xds13.ferranti.com> peter at ficc.ferranti.com (Peter da Silva) writes:
> >	execl("/bin/sh", "sh", "-c", "echo", NULL);
> >(which is a common idiom in UNIX source groups) ...

> A common INCORRECT idiom!

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 <stdio.h>.

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.
-- 
Peter da Silva; Ferranti International Controls Corporation; +1 713 274 5180;
Sugar Land, TX  77487-5012;         `-_-' "Have you hugged your wolf, today?"



More information about the Comp.std.c mailing list