Can I use static key word in user function?
FUNC char StateMachine(void) { static unsigned char _state; switch(_state) { case 0: ... } }
Q 4 U
Do you think you now have enough evidence to determine whether the static keyword is supported in that situation?
Q 4 U I doubt the OP is willing to wait till quarter 4 for an answer
From the Keil User Guide: Debug functions use a subset of the C programming language. The basic capabilities and restrictions are:
Flow control statements can be used in debug functions and operate as in ANSI C (if, else, while, do, switch, case, break, continue, and goto). Local scalar variables are declared as in ANSI C. Arrays are not allowed in debug functions.
So the keyword static is supported implicitly in variable definition. Moreover the user guide does not state it is not supported explicitly.
Not very convincing. Since your attempt to use it failed, it is certainly possible that the keyword is not supported.
As your quoted text states "The basic capabilities and restrictions are:". Note the word 'basic' there. A full list of differences could end up being quite a substantial tome.
Agreed - it certainly doesn't look like an exhaustive list.
There is, apparently, no full formal published language specification/definition.
So I would also conclude that 'static' is just not supported.
If you want a definitive answer, you are going to have to contact Keil direct.
Again, the forum is not the place to contact Keil support