Quote:
Originally Posted by Yuriy07
Also, I see that local variables are shown incorrecly when program is built with +O2 optimization switch. They show correcly with +O0 or +O1 optimization.
|
Often optimizations are incompatible with debuggers because optimizers will re-organize variables on the stack for efficiency, um, basically optimizing the thing.
Optimizers are more aggressive and less forgiving of dodgy code.
Also, if you are using C++ libraries, have these been built with the same optimizations?
Use maximum warning and errors during compilation, for HPUX compilers I use "-Aa -D_HPUX_SOURCE +e +We".
Try GCC and see if that exposes anything, again use "-Wall -Werror".