From: Guenter Roeck <linux@roeck-us.net>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: smatch@vger.kernel.org, linux-sparse@vger.kernel.org
Subject: Re: A sparse warning I dont understand in drivers/hwmon/max16065.c [was: smatch warning]
Date: Tue, 06 Aug 2013 07:53:37 -0700 [thread overview]
Message-ID: <52010DF1.6050301@roeck-us.net> (raw)
In-Reply-To: <20130806073105.GP5102@mwanda>
On 08/06/2013 12:31 AM, Dan Carpenter wrote:
> On Mon, Aug 05, 2013 at 03:00:32PM -0700, Guenter Roeck wrote:
>> Hi all,
>>
>> I get the following warning while scanning drivers/hwmon/max16065.c.
>>
>> drivers/hwmon/max16065.c:67:10: warning: Initializer entry defined twice
>> drivers/hwmon/max16065.c:68:10: also defined here
>> drivers/hwmon/max16065.c:76:10: warning: Initializer entry defined twice
>> drivers/hwmon/max16065.c:77:10: also defined here
>>
>> I must have looked at the code half a dozen times, but I just
>> don't see what might be wrong.
>>
>> Any idea, anyone ?
>
> This is actually a Sparse warning not a Smatch warning. To get the
> Smatch warnings (there aren't any) do:
Thanks for the clarification. I updated the subject.
Guenter
> ~/path/to/smatch/smatch_scripts/kchecker --spammy drivers/hwmon/max16065.c
>
> This problem is here is a bug in Sparse handling arrays of _Bool.
> Let me add the Sparse people to the CC list and a small test case.
>
> static _Bool array_name[] = {
> [0] = 0,
> [1] = 0,
> [2] = 0,
> [3] = 0,
> };
>
> Sparse complains that element 1 was already initialized.
>
> regards,
> dan carpenter
>
>
>
prev parent reply other threads:[~2013-08-06 14:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <52002080.1070701@roeck-us.net>
2013-08-06 7:31 ` A smatch warning I dont understand in drivers/hwmon/max16065.c Dan Carpenter
2013-08-06 14:53 ` Guenter Roeck [this message]
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=52010DF1.6050301@roeck-us.net \
--to=linux@roeck-us.net \
--cc=dan.carpenter@oracle.com \
--cc=linux-sparse@vger.kernel.org \
--cc=smatch@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.