编译自定义 Linux 内核时收到一些警告。我已将我的代码(用于调试)简化为:
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);
并且仍然收到这些警告(对于函数和函数指针):
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]
它们在头文件中正确声明,例如:
extern int sw_totcp(struct ip_vs_service *);
extern int (*sw_totcpcall)(struct ip_vs_service *);
可能有什么问题?