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.
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.
Flagging it "volatile" should have the desired effect.
Couldn't you just make it the return value? 'C' is perfectly happy with not using return values.
Andy already suggested the NOOVERLAY directive. That will do what you want. Jon