From owner-freebsd-bugs@FreeBSD.ORG Wed Jan 26 10:13:38 2005 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B8CC816A4CE; Wed, 26 Jan 2005 10:13:38 +0000 (GMT) Received: from fafoe.narf.at (chello084113209090.6.14.vie.surfer.at [84.113.209.90]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3EB3043D39; Wed, 26 Jan 2005 10:13:38 +0000 (GMT) (envelope-from stefan@fafoe.narf.at) Received: from wombat.fafoe.narf.at (wombat.fafoe.narf.at [192.168.1.42]) by fafoe.narf.at (Postfix) with ESMTP id 792C33FA7; Wed, 26 Jan 2005 11:13:35 +0100 (CET) Received: by wombat.fafoe.narf.at (Postfix, from userid 1001) id 8E7F216B; Wed, 26 Jan 2005 11:13:34 +0100 (CET) Date: Wed, 26 Jan 2005 11:13:34 +0100 From: Stefan Farfeleder To: keramida@ceid.upatras.gr Message-ID: <20050126101332.GI21084@wombat.fafoe.narf.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i cc: nectar@FreeBSD.org cc: freebsd-bugs@FreeBSD.org cc: sos22@cantab.net Subject: Re: Dubious #define in include/pwd.h X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2005 10:13:38 -0000 Giorgos Keramidas wrote: > On 2005-01-25 21:46, Steven Smith wrote: > > I was messing around with sparse, the static checker used sometimes > > by Linux kernel people, and I (or rather, it) came upon the line > > > > #define _PW_VERSION_MASK '0xF0' > > > > in /usr/src/include/pwd.h. I can't immediately see any use for this; > > '\xf0' would probably be more useful. > > If this is used as a mask for 'unsigned char' values, why would it make > any difference? Aren't they both going to be implicitly converted to > the right typep anyway? No, '0xF0' is a multi-character-constant, its value is implementation-defined and that's probably not what Jacques (CC'ed) intended. It probably should be just 0xF0 (without the quotes) or '\xF0'. A grep through the src tree didn't show any usage of this macro though. Stefan