diff mbox

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

Message ID 20121220072212.GO5032@mwanda (mailing list archive)
State Rejected, archived
Headers show

Commit Message

Dan Carpenter Dec. 20, 2012, 7:22 a.m. UTC
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

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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 },