Not Keil specific; one for the 'C' experts:
Why would one put 'static' variables definitions in a header?
eg, in a header file:
/* * TCO count to temperature conversion table. */ static erTcoTableStruct tcoTableOPUS1[] = { /*{TCO,Temp,} */ {1,-99}, {4,-45}, {5,-40}, {8,-35}, {11,-30}, {16,-25}, {22,-20}, {29,-15}, {37,-10}, {48,-5}, {61,0}, {78,5}, {99,10}, {124,15}, {153,20}, {188,25}, {227,30}, {270,35}, {315,40}, {365,45}, {420,50}, {481,55}, {549,60}, {625,65}, {710,70}, {805,75}, {910,80}, {1010,85}, {1060,88} };
AIUI, the whole point of so-called "header" files in 'C' is to share stuff between source files;
But the whole point of the 'static' keyword (at file scope) in 'C' is to make stuff private so that it is not visible to other modules - ie, not shared.
So I can't see why one would want to have 'static' definitions in a header?!
Even though I am unsure as to the invalidity of doing so, generally I wouldn't do it. My prior post (with he link to the picture) showed that I did make 'extern static' data references. I don't remember why I was doing so. But out of 700+ only eight were of that type in an unproven code-monkey fragment.
Here's what VC thinks of that:
error C2159: more than one storage class specified
Did you compile that code at all?
If I've managed to unpick your explanation of your header file usage you seem to define all file scope variables in a header file and all function scope variables in the function. That doesn't make a lot of sense - why hide file scope declarations in a separate file, particularly if they are not referenced outwith that file?
More than anything else, though, there's no point in ignoring convention unless you have a compelling reason to do so, and the reasons you have given so far are not compelling. They add up to little more than 'I do it my way because it's my way'.