From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mike Gran Newsgroups: gmane.lisp.guile.devel Subject: Re: `SCM_MAKE_CHAR ()' signedness issue Date: Tue, 18 Aug 2009 11:54:55 -0700 (PDT) Message-ID: <106176.81862.qm@web37905.mail.mud.yahoo.com> References: 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 1250621717 21026 80.91.229.12 (18 Aug 2009 18:55:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Aug 2009 18:55:17 +0000 (UTC) To: "carlo.bramix" , guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Aug 18 20:55:10 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 1MdTpq-0003d8-MJ for guile-devel@m.gmane.org; Tue, 18 Aug 2009 20:55:07 +0200 Original-Received: from localhost ([127.0.0.1]:56138 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MdTpp-0000SO-C0 for guile-devel@m.gmane.org; Tue, 18 Aug 2009 14:55:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MdTpm-0000RW-83 for guile-devel@gnu.org; Tue, 18 Aug 2009 14:55:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MdTph-0000NC-Fz for guile-devel@gnu.org; Tue, 18 Aug 2009 14:55:01 -0400 Original-Received: from [199.232.76.173] (port=49569 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MdTph-0000N9-Ar for guile-devel@gnu.org; Tue, 18 Aug 2009 14:54:57 -0400 Original-Received: from web37905.mail.mud.yahoo.com ([209.191.91.167]:27225) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MdTpg-0007tQ-To for guile-devel@gnu.org; Tue, 18 Aug 2009 14:54:57 -0400 Original-Received: (qmail 82906 invoked by uid 60001); 18 Aug 2009 18:54:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1250621696; bh=AtHM15eJ/3kSkO/LQ96/1VslZ7wJHemagI3zrxZv6UI=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=MI40wLMgmePX5rDrCpfirfSqX2idiZoRtHAwWngd4aoQ2lkxeWOMxqIYbNbHKWAkOM9VO4OwZ/cPPRDe0/yp0StU504flzF8BF8xqkaMdB2u3IsBjBkO047dCDfSb69Qit5ZdQIrZWzgpVaXYZf3Gk728Zq+iquXOs1yaPCi5vA= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=xHxRhSgNbvON6x1evfUimBmqZNeUOn5DcBspxHu9q0r9ECkYkjMjc4LvoTXSAddrPYeO9fNRhr+Mq6J0yYFwNX5jGF45Vq2bVXspj9qXOLxpJbispwijNRZSxFZN71jWxKlbbWuUC70DeuxC0MqSFYmWrKG3t/Ol+KhzDlOUmes=; X-YMail-OSG: bdM_vvYVM1nqgbaXuxdo9SCLjEQVXa0goPJ5OxUqyg6L8gfL7L_lpCqw Original-Received: from [207.8.91.2] by web37905.mail.mud.yahoo.com via HTTP; Tue, 18 Aug 2009 11:54:55 PDT X-Mailer: YahooMailRC/1358.27 YahooMailWebService/0.7.338.2 In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: FreeBSD 6.x (1) 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:9151 Archived-At: > From: carlo.bramix =0A> =0A> Hello,=0A> unfortuna= tely that code still fails into libguile/print.c=0A> Infact, a signed char = just arrives to 127 and the " < 128" causes:=0A> =0A> ../../guile-git/libgu= ile/print.c:1101: warning: comparison is always true due to =0A> limited ra= nge of data type=0A> ../../guile-git/libguile/print.c:1108: warning: compar= ison is always true due to =0A> limited range of data type=0A=0ADoh!=A0 You= 're right.=0A=0A> =0A> But in this manner it seems ok:=0A> =0A> #define SCM= _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 \=0A> =A0 (((scm_t_int32) (x) + 128) < 128= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 \= =0A> =A0 ? SCM_MAKE_ITAG8 ((scm_t_bits) (unsigned char) (x), scm_tc8_char)= =A0 \=0A> =A0 : SCM_MAKE_ITAG8 ((scm_t_bits) (x), scm_tc8_char))=0A=0AAlter= nately, you could put in any number between 0 and 127, I think, and get =0A= the correct behavior.=0A=0A#define SCM_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 \=0A=A0= ((x) <=A064=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 \=0A=A0 ? SCM_MAKE_ITAG8 ((scm_t= _bits) (unsigned char) (x), scm_tc8_char)=A0 \=0A=A0 : SCM_MAKE_ITAG8 ((scm= _t_bits) (x), scm_tc8_char))=0A=0A-Mike=0A