lkml.org 
[lkml]   [2010]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Sparse warning: "initializer entry defined twice"
On Thu, May 06, 2010 at 06:43:10PM -0500, Steve French wrote:
>Sparse, but not gcc, throws a warning ("make modules C=1") as follows
>on the first two lines of the following array of booleans
>
> CHECK fs/smb2/misc.c
>fs/smb2/misc.c:456:23: warning: Initializer entry defined twice
>fs/smb2/misc.c:457:27: also defined here
>
>
>static const bool has_smb2_data_area[NUMBER_OF_SMB2_COMMANDS] = {
>    /* SMB2_NEGOTIATE */ true,
>    /* SMB2_SESSION_SETUP */ true,
>    /* SMB2_LOGOFF */ false,
>    /* SMB2_TREE_CONNECT */    false,
>    /* SMB2_TREE_DISCONNECT */ false,
>    /* SMB2_CREATE */ true,
>    /* SMB2_CLOSE */ false,
>    /* SMB2_FLUSH */ false,
>    /* SMB2_READ */    true,
>    /* SMB2_WRITE */ false,
>    /* SMB2_LOCK */    false,
>    /* SMB2_IOCTL */ true,
>    /* SMB2_CANCEL */ false, /* BB CHECK this not listed in documentation */
>    /* SMB2_ECHO */ false,
>    /* SMB2_QUERY_DIRECTORY */ true,
>    /* SMB2_CHANGE_NOTIFY */ true,
>    /* SMB2_QUERY_INFO */ true,
>    /* SMB2_SET_INFO */ false,
>    /* SMB2_OPLOCK_BREAK */ false
>};
>
>
>Any idea why sparse is complaining about the first two lines of the
>arry of booleans? Is this just a sparse bug?
>

Hmm, looks weird, sparse doesn't understand bool well?

Can you construct a small C program to show this? Something like:

typedef _Bool bool;
enum {
false = 0,
true = 1
};

static const bool foo[10] = {
true,
true,
false,
false,
};
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-05-07 08:09    [W:0.113 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site