Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755303AbYGYSZY (ORCPT ); Fri, 25 Jul 2008 14:25:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751552AbYGYSZO (ORCPT ); Fri, 25 Jul 2008 14:25:14 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:43814 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750930AbYGYSZN (ORCPT ); Fri, 25 Jul 2008 14:25:13 -0400 Date: Fri, 25 Jul 2008 19:25:10 +0100 From: Al Viro To: Harvey Harrison Cc: Steve French , Andrew Morton , LKML Subject: Re: [PATCH] cifs: avoid mixing bool and le16 Message-ID: <20080725182510.GL28946@ZenIV.linux.org.uk> References: <1216857138.30386.33.camel@brick> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1216857138.30386.33.camel@brick> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1068 Lines: 28 On Wed, Jul 23, 2008 at 04:52:18PM -0700, Harvey Harrison wrote: > fs/cifs/cifssmb.c:3917:13: warning: incorrect type in assignment (different base types) > fs/cifs/cifssmb.c:3917:13: expected bool [unsigned] [usertype] is_unicode > fs/cifs/cifssmb.c:3917:13: got restricted __le16 > > Signed-off-by: Harvey Harrison It's a sparse bug - the thing doesn't treat conversions to bool right. FWIW, if you want an obviously broken case, consider char a[2 * (bool)2 - 1]; It *should* turn into char a[1]; What happens instead is that bool is treated as 1-bit unsigned integer type, resulting in char a[-1]. So we need to fix that crap; the real rules are simple - conversion of any arithmetic or pointer type to _Bool behaves as if we had v != 0; same as for if/while/do/for conditions. -- 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/