Ambiguous C?

Dave Brower daveb at gonzo.UUCP
Sun Apr 30 04:09:12 AEST 1989


In article <9249 at alice.UUCP> ark at 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 at gonzo.uucp



More information about the Comp.lang.c mailing list