gcc and NULL function pointers.

Doug Gwyn gwyn at smoke.brl.mil
Sat Jun 29 15:24:51 AEST 1991


In article <678149027.20102 at mindcraft.com> karish at mindcraft.com (Chuck Karish) writes:
>Is there a restriction that would prevent the implementation
>from producing a diagnostic for (1)?

Literally speaking, an implementation can generate spurious diagnostics
if it wishes.  However, there is supposed to be a well-defined notion of
"accepting" a strictly conforming program, and such a diagnostic if it
is indeed generated should be syntactically distinguishable from a real
diagnostic (such as the ones required by the standard).

>I wouldn't be surprised to see either  "possible pointer type mismatch"
>or "illegal combination of pointer and integer", depending on how NULL
>is defined.

Why in the world not?  All conforming implementations must define NULL
such that example (1), after NULL is macro replaced, is a strictly
conforming excerpt.  Why would they generate diagnostics for perfectly
fine code?



More information about the Comp.std.c mailing list