Uninitialized externals and statics

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Aug 26 21:23:56 AEST 1989


In article <4700042 at m.cs.uiuc.edu> kenny at m.cs.uiuc.edu writes:
>This is BROKEN.  How many times do those of us that understand this
>have to shout it?  When a pointer is compared with an integer, it is
>implicitly promoted to an integer.

That's not right either.  Pointers may validly be compared only with
pointers to the same type or with null pointer constants.  "NULL" of
course is required to act like a null pointer constant in such contexts,
and so is "0" (quote marks not included).

If you want to promote a pointer to an integral type, an explicit
cast is required.  Which integral type is appropriate is implementation
defined.



More information about the Comp.lang.c mailing list