From owner-freebsd-audit@FreeBSD.ORG Tue Mar 1 03:33:53 2005 Return-Path: Delivered-To: freebsd-audit@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D882616A4CE for ; Tue, 1 Mar 2005 03:33:53 +0000 (GMT) Received: from dragon.nuxi.com (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id A6D6743D41 for ; Tue, 1 Mar 2005 03:33:53 +0000 (GMT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.13.1/8.13.1) with ESMTP id j213XrII084494 for ; Mon, 28 Feb 2005 19:33:53 -0800 (PST) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.13.1/8.13.1/Submit) id j213XrGN084493 for freebsd-audit@freebsd.org; Mon, 28 Feb 2005 19:33:53 -0800 (PST) (envelope-from obrien) Date: Mon, 28 Feb 2005 19:33:53 -0800 From: "David O'Brien" To: freebsd-audit@freebsd.org Message-ID: <20050301033353.GA84365@dragon.nuxi.com> Mail-Followup-To: obrien@freebsd.org, freebsd-audit@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD 6.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 User-Agent: Mutt/1.5.8i Subject: quiting X warnings in /bin/sh X-BeenThere: freebsd-audit@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: obrien@freebsd.org List-Id: FreeBSD Security Audit List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2005 03:33:54 -0000 On 'i386' one gets several "comparison is always true due to limited range of data type" warnings when compiling bin/sh because PEOF is -129 and SYNBASE is 129. Which of course are outside the range of an 8-bit character. I think the correct fix is the patch below to give a range of -128..128 in the signed character case, and -1..1 in the unsigned character case. Index: mksyntax.c =================================================================== RCS file: /home/ncvs/src/bin/sh/mksyntax.c,v retrieving revision 1.23 diff -u -r1.23 mksyntax.c --- mksyntax.c 6 Apr 2004 20:06:51 -0000 1.23 +++ mksyntax.c 1 Mar 2005 03:29:50 -0000 @@ -158,7 +158,7 @@ size = (1 << nbits) + 1; base = 1; if (sign) - base += 1 << (nbits - 1); + base += (1 << (nbits - 1)) - 1; digit_contig = 1; for (i = 0 ; i < 10 ; i++) { if (digit[i] != '0' + i) -- -- David (obrien@FreeBSD.org)