* Re: Using smatch on Chrome OS kernel, cannot process "__restrict__"
[not found] <CANV8Hs2xfNo3cZ1Cp5T_F2U2vPr0ybGDrP4c=fMsNXDED7vj=g@mail.gmail.com>
@ 2012-12-20 7:22 ` Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-12-20 7:22 UTC (permalink / raw)
To: Simon Que; +Cc: smatch, linux-sparse
On Wed, Dec 19, 2012 at 06:06:43PM -0800, Simon Que wrote:
> Hi,
>
> I am trying to apply smatch to the Chrome OS kernel, which is a
> modified Linux Kernel 3.4. There is one "error" that smatch is having
> trouble processing. It is in drivers/md/dm-bht.c:
>
> sprintf((char *__restrict__)hex, "%02hhx", (int)*binary);
>
> The word "__restrict__" is throwing off smatch somehow and it causes
> the build to fail.
>
> When I run make without smatch, the build passes.
> When remove the "__restrict__" and make CHECK=smatch, the build passes.
>
Thanks for the report. That's a Sparse thing.
I'll commit this patch with a:
Reported-by: Simon Que <sque@google.com>
regards,
dan carpenter
diff --git a/parse.c b/parse.c
index 5dd9a06..bf5894d 100644
--- a/parse.c
+++ b/parse.c
@@ -419,6 +419,7 @@ static struct init_keyword {
/* Ignored for now.. */
{ "restrict", NS_TYPEDEF, .op = &restrict_op},
{ "__restrict", NS_TYPEDEF, .op = &restrict_op},
+ { "__restrict__", NS_TYPEDEF, .op = &restrict_op},
/* Storage class */
{ "auto", NS_TYPEDEF, .op = &auto_op },
^ permalink raw reply related [flat|nested] only message in thread