sizeof a struc field

Dave Rifkind dave at dsi.COM
Mon Oct 16 12:26:28 AEST 1989


In lots of articles (see References), lots of people say lots of things:

Would you think me irascible if I were to say that youse guys have gone
standard-happy?

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.

It's the compiler's job to convert syntactically valid source into
object code.  It is not the compiler's job to worry about runtime
semantics.

And, yes, *every* pointer has a type.  The contents of that pointer,
whether constant at compile time or variable, do not affect this.



More information about the Comp.lang.c mailing list