If I implement function as weak function in this way for example:
a.h:
int func1();
a.c:
#include "a.h"
__attribute__((weak)) int func1() {
...
}
Is it possible to implement this function in another file, for example X.c as a static function? for example:
#include "a.h"
static int func1(void) { <<----------- error
...
}
I tried to do it but I got this error:
error: static declaration of `func1` follows non-static declaration
But I'm not sure why I can't to do that.. After all, this is a static function only in X.c
file..