From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Greg Troxel Newsgroups: gmane.lisp.guile.devel Subject: unsigned char confusion Date: Tue, 11 Aug 2009 09:39:34 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1249998216 6836 80.91.229.12 (11 Aug 2009 13:43:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Aug 2009 13:43:36 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Aug 11 15:43:28 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MardP-000705-Ok for guile-devel@m.gmane.org; Tue, 11 Aug 2009 15:43:28 +0200 Original-Received: from localhost ([127.0.0.1]:51742 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MardO-0006Q9-A0 for guile-devel@m.gmane.org; Tue, 11 Aug 2009 09:43:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MarZl-0004G7-0l for guile-devel@gnu.org; Tue, 11 Aug 2009 09:39:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MarZg-0004E2-8z for guile-devel@gnu.org; Tue, 11 Aug 2009 09:39:40 -0400 Original-Received: from [199.232.76.173] (port=45288 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MarZg-0004Dy-4l for guile-devel@gnu.org; Tue, 11 Aug 2009 09:39:36 -0400 Original-Received: from fnord.ir.bbn.com ([192.1.100.210]:55888) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MarZf-0008VD-LI for guile-devel@gnu.org; Tue, 11 Aug 2009 09:39:35 -0400 Original-Received: by fnord.ir.bbn.com (Postfix, from userid 10853) id F005553E7; Tue, 11 Aug 2009 09:39:34 -0400 (EDT) X-Hashcash: 1:20:090811:guile-devel@gnu.org::MfnwxS1+9O/rUjEL:00000000000000000000000000000000000000000011Y0 X-Hashcash: 1:20:090811:wingo@pobox.com::qbVe6I8ySGkbneOT:001vrN In-Reply-To: (Andy Wingo's message of "Mon, 10 Aug 2009 21:41:10 +0200") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.3 (berkeley-unix) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9057 Archived-At: --=-=-= In srfi-13.c line 25222, SCM_MAKE_CHAR is called with an argument that is an unsigned char. This leads to: cc1: warnings being treated as errors srfi-13.c: In function 'string_titlecase_x': srfi-13.c:2522: warning: comparison is always false due to limited range of data type srfi-13.c:2522: warning: comparison is always false due to limited range of data type This is because SCM_MAKE_CHAR (in libguile/chars.h) has a bizarre conditional that checks the argument for < 0, and if so casts it to unsigned char. Otherwise it does not cast. There is no comment that explains what the point is. Fairly obviously this is an attempt to avoid sign extension during SCM_MAKE_ITAG8. The value is then cast to uintptr_t which is also unsigned, but sign extension would set more bits. So, I think the cast to unsigned char should just always be there, without the test. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (NetBSD) iEYEARECAAYFAkqBdJYACgkQ+vesoDJhHiWlewCePhwyfCR7xhu9kqra+584tHnG iVAAoJc71Q0eo6VVmpNxnh9gcnsgjwlq =i8px -----END PGP SIGNATURE----- --=-=-=--