Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!rutgers!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Uninitialized externals and statics Message-ID: <10821@smoke.BRL.MIL> Date: 26 Aug 89 11:23:56 GMT References: <2128@infmx.UUCP> <4700042@m.cs.uiuc.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 13 In article <4700042@m.cs.uiuc.edu> kenny@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.