warning: initialization from incompatible pointer type 分析
2011-08-16 15:33
666 查看
在字符驱动中,这行代码报了警告信息:
经分析是因为函数声明与函数的原型不符,将其中的
同样,
函数原型以及file_operations成员分析参考http://blog.sina.com.cn/s/blog_56332e1d0100crc8.html
warning: initialization from incompatible pointer type
static ssize_t s3c2440_key_read(struct file *filp, char __user *buf, ssize_t count, loff_t *ppos);
经分析是因为函数声明与函数的原型不符,将其中的
ssize_t count改成
size_t count就可以了。
同样,
static void s3c2440_key_release(struct inode *inode, struct file *filp);将其中的
void改成
int就可以了。
函数原型以及file_operations成员分析参考http://blog.sina.com.cn/s/blog_56332e1d0100crc8.html
相关文章推荐
- warning: initialization from incompatible pointer type
- container_of 报出 warning: initialization from incompatible pointer type 解决办法
- 关于警告:initialization from incompatible pointer type [enabled by default]
- warning: passing argument 2 of 'request_irq' from incompatible pointer type导致的中断申请失败和模块无法加载
- 关于问题warning: passing arg 2 of `bind' from incompatible pointer type理解
- warning: assignment from incompatible pointer type (注册hook时出现了)
- warning: passing argument 2 of 'request_irq' from incompatible pointer type导致的中断申请失败和
- warning:initialization discards ‘const’ qualifier from pointer target type 解决方法
- warning: passing arg 1 of `strlen' from incompatible pointer type是什么原因?
- initialization from incompatible pointer type
- warning: assignment from incompatible pointer type [enabled by default]
- warning: passing argument 2 of 'request_irq' from incompatible pointer type导致的中断申请失败和
- Incompatible pointer types returning 'NSArray *' from a function with result type 'xxx *'
- “passing argument 2 0f “request_irq” from incompatible pointer type”导致中断申请失败和模块无法加载
- initialization discards 'const' qualifier from pointer target type
- warning: initialization makes pointer from integer without a cast
- “passing argument 2 0f “request_irq” from incompatible pointer type”导致中断申请失败和模块无法加载
- X86_64上没有写C函数声明导致的BUG(warning: initialization makes pointer from integer without a cast)
- warning: assignment discards qualifiers from pointer target type
- assignment from incompatible pointer type