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 linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux