Technical Support

C166: WARNING 189 (STORAGE CLASS CHANGED TO STATIC)


Information in this article applies to:

  • C166 Version 4.03

QUESTION

I receive the following warning message:

*** WARNING 189 IN LINE 5 OF .\MAIN.C: 'xxx': storage class changed to 'static'

when I compile the following function:

void main (void)
{
int i;
int j;
int idata asdf;

i = 100;
j = 1000;
asdf = i + j;
}

that has a local variable stored in the idata area.

What does this mesn?

ANSWER

By default, the C166 compiler stores local variables in a stack frame on the user stack. When you override the storage area for a local variable, you make that function non-reentrant. (Since a new copy of the idata variable is not created for each entry into the function).

This warning message is intended to alert you to the fact that you have declared a static variable inside the function without using the static keyword.

RESOLUTION

If you want the function to still be reentrant, you must remove the storage area from the variable declaration. Or, you must move that variable declaration outside of the function.

Last Reviewed: Sunday, March 12, 2000


Did this article provide the answer you needed?
 
Yes
No
Not Sure