This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Error 34 may be feature, not bug: can't watch or debug optimized-out variables

Hi everyone,

A noncontributing variable to the return value may be optimized out - probably depends on your compiler settings.

If you add that variable to the watch window while debugging, you may get

 *** error 34: undefined identifier

This is most likely a feature, not a bug - after all, don't you want optimization?

There's probably a couple ways to fix this -
1. modify your compiler settings.
2. change the variable to a "static" for debugging.
3. have your variable contribute to the return value.

Using uVision 3.

0