linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Simon Que <sque@google.com>
Cc: smatch@vger.kernel.org, linux-sparse@vger.kernel.org
Subject: Re: Using smatch on Chrome OS kernel, cannot process "__restrict__"
Date: Thu, 20 Dec 2012 10:22:13 +0300	[thread overview]
Message-ID: <20121220072212.GO5032@mwanda> (raw)
In-Reply-To: <CANV8Hs2xfNo3cZ1Cp5T_F2U2vPr0ybGDrP4c=fMsNXDED7vj=g@mail.gmail.com>

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

           reply	other threads:[~2012-12-20  7:22 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CANV8Hs2xfNo3cZ1Cp5T_F2U2vPr0ybGDrP4c=fMsNXDED7vj=g@mail.gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121220072212.GO5032@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=smatch@vger.kernel.org \
    --cc=sque@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).