Subj : Re: Any help on why? To : borland.public.cpp.borlandcpp From : Bob Gonder Date : Wed Jul 07 2004 12:25 pm Stan DeGroff wrote: >BC++ V5.02 Copyright 1997 > >You've come up with exactly what I think was going on. I've seen other >cases do the same. >printf doesn't seem to invoke code that produces values that stick around >beyond their non-printf use. I've seen it too, so figured that might be it, but see my post of 10 minutes ago for your real problem. >When I look at the CPU screen I see that code is optimized. (Even though I >have "no optimization" checked in the project->options screen. Some >statements can't be used as break points as they have been optimized away as >well.) > >Is there a way to insure optimization is not invoked? Not entirely. Best you can do is notice the bug and work around it by making the value global, or doing something (just about anything) with it later in the code. .