解决: 编译警告 : “warning: function declaration isn't a prototype ”
2013-05-29 23:52
651 查看
static int hello_init_module(void)
{
printk("Hello, world - this is the kernel speaking\n");
return 0;
}
/* Cleanup - undid whatever init_module did */
static void hello_cleanup_module(void)
{
printk("Short is the life of a kernel module\n");
}
module_init(hello_init_module);
module_exit(hello_cleanup_module);
上面代码是内核中的一个模块, 如果 static int hello_init_module(void) 括号里面没有加void就会出现此警告。
{
printk("Hello, world - this is the kernel speaking\n");
return 0;
}
/* Cleanup - undid whatever init_module did */
static void hello_cleanup_module(void)
{
printk("Short is the life of a kernel module\n");
}
module_init(hello_init_module);
module_exit(hello_cleanup_module);
上面代码是内核中的一个模块, 如果 static int hello_init_module(void) 括号里面没有加void就会出现此警告。
相关文章推荐
- warning: function declaration isn't a prototype 解决方法
- 编译LED驱动时,提示: warning: function declaration isn't a prototype
- warning: function declaration isn't a prototype原因分析
- function declaration isn't a prototype解决办法
- warning: function declaration isn't a prototype
- function declaration isn't a prototype 如何解决
- implicit declaration of function 'asprintf' 警告的解决
- 如何解决warning:implicit declaration of function 'xxx'
- 解决warning:implicit declaration of function 'Xil_Out32' [-Wimplicit-function-declaration]
- linux驱动中出错function declaration isn't a prototype
- 警告:warning: function declaration isn't a prototype
- warning: function declaration isn’t a prototype(函数声明不是原型)的解决办法
- warning: function declaration isn’t a prototype(函数声明不是原型)的解决办法
- gcc下编译出现warning:implicit declaration of function 'strdup'和warning:implicit declaration of function 'gethostname'
- warning: function declaration isn’t a prototype解决方法
- 关于warning: function declaration isn’t a prototype(函数声明不是原型)的解决办法
- warning: function declaration isn’t a prototype的解决方法
- warning: function declaration isn’t a prototype(函数声明不是原型)的解决办法
- warning: function declaration isn’t a prototype(函数声明不是原型)的解决办法
- function declaration isn't a prototype 是什么原因