linux内核模块配置,如何为linux内核模块开发配置clang_complete?
我試圖讓
gcc到
dump the include paths,我的
.clang_complete文件現(xiàn)在看起來像:
-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仍然抱怨大量的錯(cuò)誤.編輯簡(jiǎn)單的hello world內(nèi)核模塊時(shí)發(fā)出警告.
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中
總結(jié)
以上是生活随笔為你收集整理的linux内核模块配置,如何为linux内核模块开发配置clang_complete?的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 消息称华为P60系列运存依然8GB起 3
- 下一篇: 造车新势力2月交付量出炉:理想、蔚来、哪