明天测试下最新clang complete,希望已经搞好了!

点击打开链接

The cc_args.py bundled with clang_complete could have been useful to you. It should build a valid .clang_complete file. Unfortunately (I've just tested it, and I will try to fix it), it doesn't work here (the .clang_complete file could not be created).

However, by tweaking the script and its result, I've been able to produce a valid .clang_complete file :

-D__KERNEL__
-DCONFIG_AS_CFI=1
-DCONFIG_AS_CFI_SIGNAL_FRAME=1
-DCONFIG_AS_CFI_SECTIONS=1
-DCONFIG_AS_FXSAVEQ=1
-nostdinc
-I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/include
-I/usr/src/linux-3.2.12-1-ARCH/arch/x86/include
-I/usr/src/linux-3.2.12-1-ARCH/arch/x86/include/generated
-I/usr/src/linux-3.2.12-1-ARCH/include
-DMODULE
-DKBUILD_STR(s)=#s
-include /usr/src/linux-3.2.12-1-ARCH/include/linux/kconfig.h

With this .clang_complete, there is only one error left, related to __kfree_rcu, for more information about it, see : https://lkml.org/lkml/2012/1/12/2

When compiling kernel or module code with -O0, "offset" is no longer
considered a constant, and therefore always triggers the build error
that BUILD_BUG_ON is defined to yield.

What is the rationale between the forced constant check,
introduced in 9ab1544eb4196ca8d05c433b2eb56f74496b1ee3?

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 include/linux/rcupdate.h |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 2cf4226..38c5ba5 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -805,8 +805,6 @@ void __kfree_rcu(struct rcu_head *head, unsigned long offset)
 {
 	typedef void (*rcu_callback)(struct rcu_head *);
 
-	BUILD_BUG_ON(!__builtin_constant_p(offset));
-
 	/* See the kfree_rcu() header comment. */
 	BUILD_BUG_ON(!__is_kfree_rcu_offset(offset));
 
-- 
1.7.7

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值