I am getting some warnings when compiling a custom Linux kernel. I have reduced my code (for debugging) to this:
int sw_totcp(struct ip_vs_service *svc)
{
return(1);
}
EXPORT_SYMBOL(sw_totcp);
int (*sw_totcpcall)(struct ip_vs_service *) = &sw_totcp;
EXPORT_SYMBOL(sw_totcpcall);
And still getting these warnings (for both the function and the function pointer):
warning: data definition has no type or storage class [enabled by default]
warning: type defaults to ‘int’ in declaration of ‘EXPORT_SYMBOL’ [-Wimplicit-int]
warning: parameter names (without types) in function declaration [enabled by default]
They are properly declared in a header file like:
extern int sw_totcp(struct ip_vs_service *);
extern int (*sw_totcpcall)(struct ip_vs_service *);
What may be wrong?
It looks like you are not including the header where
EXPORT_SYMBOLmacro is defined. That is why the compiler is complaining about an implicit declaration: it thinks it’s a function returning anint.