Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Feb 2005 19:33:53 -0800
From:      "David O'Brien" <obrien@freebsd.org>
To:        freebsd-audit@freebsd.org
Subject:   quiting X warnings in /bin/sh
Message-ID:  <20050301033353.GA84365@dragon.nuxi.com>

next in thread | raw e-mail | index | archive | help
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)


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050301033353.GA84365>