lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100507061136.GC5921@cr0.nay.redhat.com>
Date:	Fri, 7 May 2010 14:11:36 +0800
From:	Américo Wang <xiyou.wangcong@...il.com>
To:	Steve French <smfrench@...il.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: 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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ