Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Referencing NULL pointers Message-ID: <10862@smoke.BRL.MIL> Date: 28 Aug 89 20:37:50 GMT References: <32UP02Eg3d=801@amdahl.uts.amdahl.com> <1382@bruce.OZ> <10830@smoke.BRL.MIL> <9838@xanth.cs.odu.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 10 In article <9838@xanth.cs.odu.edu> kremer@cs.odu.edu (Lloyd Kremer) writes: > p = 0; /* integer variable that happens to be set to zero */ > data = *(int *)p; /* no constant expression in this line */ >I would think the "promotion to nil pointer" rule would not apply here. Correct, as Chris has already pointed out. However I think there are enough requirements imposed on converting between integers and pointers that if you allow the above you'll also have to make the null pointer a funny bit pattern, with resulting higher overhead than most people would think necessary in that environment. I don't have a formal proof though..