Function declarators in C
6.7.6.3 Function declarators
2)The only storage-class specifier that shall occur in a parameter
declaration
is register.
6.7.6.3 Function declarators
13) The storage-class specifier in the declaration specifiers for a parameter
declaration, if present, is ignored unless the declared parameter is one
of the
members of the parameter type list for a function definition.
I have declared and defined like this...
int function(static int param)
{
return param;
}
Visual Studio is throwing a warning. What I understood is, if we use
register as a parameter type in the declaration of a function, it should
compile without warning. Other than register, it will ignore the storage
class and throw a warning message to user. Is my understanding proper?
Thanks
No comments:
Post a Comment