Powered by Linux
Re: Using smatch on Chrome OS kernel, cannot process "__restrict__" — Semantic Matching Tool

Re: Using smatch on Chrome OS kernel, cannot process "__restrict__"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

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 },
--
To unsubscribe from this list: send the line "unsubscribe smatch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux