Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!ames!amdahl!rtech!gonzo!daveb From: daveb@gonzo.UUCP (Dave Brower) Newsgroups: comp.lang.c Subject: Re: Ambiguous C? Message-ID: <630@gonzo.UUCP> Date: 29 Apr 89 18:09:12 GMT References: <111@ssp1.idca.tds.philips.nl> <9249@alice.UUCP> Reply-To: daveb@gonzo.UUCP (Dave Brower) Organization: Gonzo Media Group Lines: 22 In article <9249@alice.UUCP> ark@alice.UUCP (Andrew Koenig) suggests: >To suppress the optimization, you can probably conceal the >value of SCU_BDID from the compiler by using it in a way that >the compiler thinks might change. For instance: > > static int SCU_BDID = 0x2000; > >Now the compiler probably won't be smart enough to realize that ^^^^^^^^ >SCU_BDID is really a constant, so it will have to generate code >that caters to any bit in the whole word being on. Since it is static, the compiler might be able to figure it out. To get a higher degree of confidence, you can remove the static, showing the compiler that some other file might know about the variable and change it. -dB -- "An expert is someone who's right 75% of the time" {sun,mtxinu,amdahl,hoptoad}!rtech!gonzo!daveb daveb@gonzo.uucp