I want to have a static function which I declare in my .c file before defining it:
//file a.c version 1
static int foo();
...
static int foo()
{
...
}
The static attribute changes the visibility to the compilation unit. This allows to use the same name in different files for different purposes. You should use the static only once. If you have a prototype, you must do here.
When you are asking for C++ you should not use static but anonymous namespace to make the symbold private for the compilation unit:
namespace {
int foo();
}
void bar()
{
foo();
}