gcc and NULL function pointers.

Sean Eric Fagan sef at kithrup.COM
Mon Jun 10 18:19:24 AEST 1991


In article <1991Jun10.073125.25120 at tkou02.enet.dec.com> diamond at jit533.enet@tkou02.enet.dec.com (Norman Diamond) writes:
>Yes indeed, the best way to implement a processor for the language does not
>handle the case where a programmer doesn't know how to use the language.
>So what?

ANSI does not require a prototype for non-variardic functions (as far as I
can tell).  As a result, for a certain class of popular machines, under
certain compiler options, defining NULL as 0 will be incorrect, while
'(void*)0' is correct.

And the program that would core-dump on this would be perfectly correct,
according to ANSI.  The header file would, therefore, be wrong.

-- 
Sean Eric Fagan  | "I made the universe, but please don't blame me for it;
sef at kithrup.COM  |  I had a bellyache at the time."
-----------------+           -- The Turtle (Stephen King, _It_)
Any opinions expressed are my own, and generally unpopular with others.



More information about the Comp.std.c mailing list