找回密码
 注册
搜索
热搜: 回贴
微赢网络技术论坛 门户 服务器 Linux/BSD 查看内容

warning: function declaration isn't a prototype

2009-12-20 13:50| 发布者: admin| 查看: 91| 评论: 0|原作者: 心然


screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://blog.chinaunix.net/templates/tech/images/w_right_top.gif');}" onmousewheel="return imgzoom(this);" alt="" />
warning: function declaration isn't a prototype
warning: function declaration isn't a prototype
出现此警告原因:
1: 函数没有声明。在你调用的这个函数前面加上该函数的定义即可。
main()
{
test();
}
test (int a)
{
printf("test: %d\n", a);
}
这个代码中如果在main函数前面加上“test (int a);”就可以正确运行了
2:
#include
#include
#include
#include
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就会出现此警告。





最新评论

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-30 01:36 , Processed in 0.105805 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

返回顶部