Standard C does not formally define the value of a storage class.
It defines what a “storage class specifier” is — one of the keywords typedef , extern , static , _Thread_local , auto and register .
Functions can be declared using storage class specifiers extern or static .
The standard refers to objects that have a "storage class" in several places, for example
If the array object has a register storage class, the behavior is undefined
but it’s never determined what an object storage class is. It might be reasonable to assume that this is a storage class specifier keyword that appears in one of the declarations, but it remains unclear what will happen if some declarations of the same object have a storage class specifier and others do not. It is also not defined what is the storage class of an object that does not have a declaration with a storage class specifier.
It seems that you should avoid talking about the storage classes of objects or functions in general, and instead use the related concepts of storage duration and binding, which are precisely defined by the standard. When necessary, use phrases such as “storage class specifier X” in the declaration, but not “object / function has storage class X”.
source share