sizeof a struc field

Doug Gwyn gwyn at smoke.BRL.MIL
Tue Oct 17 14:44:35 AEST 1989


In article <277 at dsi.COM> dave at dsi.UUCP (Dave Rifkind) writes:
>Doug Gwyn (I think) says that dereferencing a null pointer is
>"syntactically meaningless".  Nuts!  "Null pointer" is not a syntactic
>concept--it's meaningful only at runtime.  Any pointer is potentially a
>null pointer; you can't determine "nullness" syntactically.  To suggest
>that a compiler should police runtime errors at compile time is silly.

I said that dereferencing a null pointer CONSTANT was meaningless,
and it is EXACTLY the kind of thing I want compilers to check for
me at compile time.  There is no service being rendered by a compiler,
when it is in a position to detect a usage error at compile time,
silently proceeding to generate code that may blow up at run time.



More information about the Comp.lang.c mailing list