warning: assignment from incompatible pointer type (注册hook时出现了)
来源:互联网 发布:金山数据恢复大师官网 编辑:程序博客网 时间:2024/06/05 01:10
在<Linux/netfilter.h>中的钩子函数的签名是:
unsigned int nf_hookfn(unsigned int hooknum,struct sk_buff **skb, const struct net_device *in, const struct net_device *out, int (*okfn) (struct sk_buff *))
当我将nf_hookfn函数赋值给hook时,就出现了warning: assignment from incompatible pointer type的错误。
后来改为:
unsigned int nf_hookfn(unsigned int hooknum,struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn) (struct sk_buff *))编译通过。说明从kernel 2.6.*开始,函数的参数值变化了。
- warning: assignment from incompatible pointer type (注册hook时出现了)
- assignment from incompatible pointer type
- warning: initialization from incompatible pointer type 分析
- warning: initialization from incompatible pointer type
- container_of 报出 warning: initialization from incompatible pointer type 解决办法
- warning: assignment discards qualifiers from pointer target type
- initialization from incompatible pointer type
- linux c 编译时出现warning: assignment makes pointer from integer without a cast原因
- warning: passing argument 2 of 'request_irq' from incompatible pointer type导致的中断申请失败和
- 关于问题warning: passing arg 2 of `bind' from incompatible pointer type理解
- warning: passing argument 2 of 'request_irq' from incompatible pointer type导致的中断申请失败和
- c++经验总结(1):linux c 编译时出现warning: assignment makes pointer from integer without a cast原因
- 出现警告:incompatible pointer types returning from a function with result type
- warning: passing argument 2 of 'request_irq' from incompatible pointer type导致的中断申请失败和模块无法加载
- warning:discards qualifiers from pointer target type
- warning: assignment makes pointer from integer without a cast错误
- 【warning: assignment makes pointer from integer without a cast 】
- warning: assignment makes pointer from integer without a cast
- UCenter同步登录和数据仓库的原理总结
- 运用管道(pipe)进行进程间通信
- 追MM与设计模式
- JAVA学习——IO操作(四)——缓冲处理流
- 改Windows记事本(notepad)默认编码为Unicode或UTF-8
- warning: assignment from incompatible pointer type (注册hook时出现了)
- git 中文支持配置
- Java编程中“为了性能”尽量要做到的一些地方
- 正则表达式
- C++类中成员变量的内存分配
- Android UI学习 - Menu
- java读取xml文件的四种方法
- Field的getModifiers()方法返回int类型值表示该字段的修饰符
- NSSet 集合对象