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

Optimization Level 0

Does anyone know how to make the compiler not overlay unused
subroutine parameter locations with local variables? It's obvious to just set it
to something after the point in which you want to look at it. But, optimization 0,
doesn't prevent it.

Parents
  • I have unused parameters for a very specific reason. I am commanding a chip
    to perform a function, which fails every once and a while. When a failed condition
    occurs in my routine, I would like to view on which command the chip failed.
    Otherwise, the command variable is not used in the routine. This is strictly for
    debugging the routine. However, since it is unused, it gets corrupted by local
    variables by the compiler. The easy answer is to always assign the variable to
    some bogus value as the last statement in the routine. That way the compiler
    things you are using it. I just wanted to know if there was any way of not having
    to do that.

Reply
  • I have unused parameters for a very specific reason. I am commanding a chip
    to perform a function, which fails every once and a while. When a failed condition
    occurs in my routine, I would like to view on which command the chip failed.
    Otherwise, the command variable is not used in the routine. This is strictly for
    debugging the routine. However, since it is unused, it gets corrupted by local
    variables by the compiler. The easy answer is to always assign the variable to
    some bogus value as the last statement in the routine. That way the compiler
    things you are using it. I just wanted to know if there was any way of not having
    to do that.

Children