From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "carlo\.bramix" Newsgroups: gmane.lisp.guile.devel Subject: Re: `SCM_MAKE_CHAR ()' signedness issue Date: Tue, 18 Aug 2009 20:39:54 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1250620816 18111 80.91.229.12 (18 Aug 2009 18:40:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Aug 2009 18:40:16 +0000 (UTC) To: "guile-devel" Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Aug 18 20:40:09 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 1MdTbM-0005lp-C1 for guile-devel@m.gmane.org; Tue, 18 Aug 2009 20:40:08 +0200 Original-Received: from localhost ([127.0.0.1]:57323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MdTbL-0000cF-SH for guile-devel@m.gmane.org; Tue, 18 Aug 2009 14:40:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MdTbJ-0000bf-La for guile-devel@gnu.org; Tue, 18 Aug 2009 14:40:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MdTbF-0000ZT-4r for guile-devel@gnu.org; Tue, 18 Aug 2009 14:40:05 -0400 Original-Received: from [199.232.76.173] (port=52850 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MdTbE-0000Z0-R8 for guile-devel@gnu.org; Tue, 18 Aug 2009 14:40:00 -0400 Original-Received: from cp-out4.libero.it ([212.52.84.104]:55700) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MdTbE-0005Si-5c for guile-devel@gnu.org; Tue, 18 Aug 2009 14:40:00 -0400 Original-Received: from libero.it (192.168.17.6) by cp-out4.libero.it (8.5.107) id 4A89688D000958C0 for guile-devel@gnu.org; Tue, 18 Aug 2009 20:39:54 +0200 X-Sensitivity: 3 X-XaM3-API-Version: 4.3 (R1) (B3pl25) X-SenderIP: 213.203.169.135 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:9150 Archived-At: Hello, unfortunately that code still fails into libguile/print.c Infact, a signed char just arrives to 127 and the " < 128" causes: ../../guile-git/libguile/print.c:1101: warning: comparison is always true= due to limited range of data type ../../guile-git/libguile/print.c:1108: warning: comparison is always true= due to limited range of data type But in this manner it seems ok: #define SCM_MAKE_CHAR(x) \ (((scm_t_int32) (x) + 128) < 128 \ ? SCM_MAKE_ITAG8 ((scm_t_bits) (unsigned char) (x), scm_tc8_char) \ : SCM_MAKE_ITAG8 ((scm_t_bits) (x), scm_tc8_char)) Sincerely, Carlo Bramini. ---------- Initial Header ----------- >From : guile-devel-bounces+carlo.bramix=3Dlibero.it@gnu.org To : "Ludovic Court=E8s" ludo@gnu.org, guile-devel@gnu.org Cc : Date : Tue, 18 Aug 2009 10:32:29 -0700 (PDT) Subject : Re: `SCM_MAKE_CHAR ()' signedness issue > > From: Ludovic Court=E8s > > To: guile-devel@gnu.org > > Sent: Monday, August 17, 2009 8:33:03 AM > > Subject: Re: `SCM_MAKE_CHAR ()' signedness issue > > > > I'm fairly confident that for such a small piece of code inlining is > > always a good idea. > > OK.=A0 If the comparison is modified to become > > 35 #define=A0SCM_MAKE_CHAR(x)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0\ > 36 =A0=A0(((x)=A0<=A0128)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0\ > 37 =A0=A0=A0?=A0SCM_MAKE_ITAG8=A0((scm_t_bits)=A0(unsigned=A0char)=A0(x= ),=A0scm_tc8_char)=A0=A0=A0\ > 38 =A0=A0=A0:=A0SCM_MAKE_ITAG8=A0((scm_t_bits)=A0(x),=A0scm_tc8_char)) > > Then hopefully that will solve all the build problems. > > > Thanks, > > Ludo'. > > -Mike > > > >