linux内核模块配置,如何为linux内核模块开发配置clang_complete?

我试图让

gcc到

dump the include paths,我的

.clang_complete文件现在看起来像:

-std=gnu89

-nostdinc

-I/usr/src/linux-headers-3.0.0-16-generic/arch/x86/include

-I/lib/modules/3.0.0-16-generic/build/arch/x86/include/generated

-I/lib/modules/3.0.0-16-generic/build/include

-I/lib/modules/3.0.0-16-generic/build/ubuntu/include

-I/usr/lib/gcc/i686-linux-gnu/4.6.1/include

-D__KERNEL__

-DMODULE

但是,libclang仍然抱怨大量的错误.编辑简单的hello world内核模块时发出警告.

1 /lib/modules/3.0.0-16-generic/build/include/linux/list.h|24 col 42 warning| declaration of 'struct list_head' will not be visible outside of this function

2 /lib/modules/3.0.0-16-generic/build/include/linux/list.h|26 col 6 error| incomplete definition of type 'struct list_head'

3 /lib/modules/3.0.0-16-generic/build/include/linux/list.h|24 col 42 info| forward declaration of 'struct list_head'

4 /lib/modules/3.0.0-16-generic/build/include/linux/list.h|27 col 6 error| incomplete definition of type 'struct list_head'

5 /lib/modules/3.0.0-16-generic/build/include/linux/list.h|24 col 42 info| forward declaration of 'struct list_head'

6 /lib/modules/3.0.0-16-generic/build/include/linux/list.h|37 col 38 warning| declaration of 'struct list_head' will not be visible outside of this function

...

从< linux / types.h>中定义struct list_head;已包含在< linux / list.h>中.两者都在/lib/modules/3.0.0-16-generic/build/include中

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值