lkml.org 
[lkml]   [2014]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Sparse warning: "initializer entry defined twice" - sparse can't handle bool?
[adding linux-sparse mailing list]

On 10/19/14 02:46, Mariusz Gorski wrote:
> Sparse throws the following warning, which I can't really understand:
>
> $ make drivers/staging/vt6655/ C=2
> [...]
> CHECK drivers/staging/vt6655/datarate.c
> drivers/staging/vt6655/datarate.c:302:40: warning: Initializer entry
> defined twice
> drivers/staging/vt6655/datarate.c:302:46: also defined here
>
> The code looks fine to me:
> bool bAutoRate[MAX_RATE] = {true, true, true, true, false, false,
> true, true, true, true, true, true};
>
> I've googled it and found only this LKML discussion:
> https://lkml.org/lkml/2010/5/7/31
>
> I've tested the suggested code sample and here are the results:
> $ cat foo.c
> typedef _Bool bool;
> enum {
> false = 0,
> true = 1
> };
> static const bool foo[10] = {
> true,
> true,
> false,
> false,
> };
>
> $ sparse foo.c
> foo.c:7:8: warning: Initializer entry defined twice
> foo.c:8:8: also defined here
>
> It this a sparse problem?
>
> Thanks,
> Mariusz
> --


--
~Randy


\
 
 \ /
  Last update: 2014-10-19 20:01    [W:0.127 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site