I am trying to find some official confirmation on a theory with respect to C functions. In a simple project of mine, I have a function which I only want to be visible within the .c
file in which it is defined. The function prototype is:
static int sum(int a, int b);
The function definition is:
int sum(int a, int b) {
return (a+b);
}
Upon analysis of the build output, link maps, etc, it seems that the function is indeed static. I'm surprised that I don't get any build warnings or errors either. However, is there anything in terms of documentation (ie: specific line in the GCC manual) that can confirm this behavior, or what is expected?
I have found the equivalent of this question for C++ (Static keyword in function declaration can be missing in function definition?), but I am looking for the answer with respect to pure C.
Thank you.