We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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.
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. There's a fourth way: record the fact that the variable has been optimized out in the debugging information and report it as such in the debugger.
Agree, it'd be nice to see
Variable has been optimized out, cannot watch or debug
instead of
"Error 34 - undefined identifier."
To Keil - this is a feature request.