From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Raeburn Newsgroups: gmane.lisp.guile.devel Subject: Re: `SCM_MAKE_CHAR ()' signedness issue Date: Sun, 16 Aug 2009 17:58:25 -0400 Message-ID: <455025BA-B847-4CE3-A81E-785A48ADD1D3@raeburn.org> References: <87y6pll21u.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=WINDOWS-1252; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1250459942 10610 80.91.229.12 (16 Aug 2009 21:59:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Aug 2009 21:59:02 +0000 (UTC) Cc: guile-devel@gnu.org To: =?ISO-8859-1?Q?Ludovic_Court=E8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Aug 16 23:58:55 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 1Mcnkc-0006QQ-Uh for guile-devel@m.gmane.org; Sun, 16 Aug 2009 23:58:55 +0200 Original-Received: from localhost ([127.0.0.1]:49463 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mcnkc-0004ek-FH for guile-devel@m.gmane.org; Sun, 16 Aug 2009 17:58:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1McnkX-0004ec-0h for guile-devel@gnu.org; Sun, 16 Aug 2009 17:58:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1McnkR-0004eQ-L7 for guile-devel@gnu.org; Sun, 16 Aug 2009 17:58:47 -0400 Original-Received: from [199.232.76.173] (port=33699 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1McnkR-0004eN-Gh for guile-devel@gnu.org; Sun, 16 Aug 2009 17:58:43 -0400 Original-Received: from splat.raeburn.org ([69.25.196.39]:43620 helo=raeburn.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1McnkE-0006nc-AO; Sun, 16 Aug 2009 17:58:41 -0400 Original-Received: from [10.0.0.172] (squish.raeburn.org [10.0.0.172]) by raeburn.org (8.14.3/8.14.1) with ESMTP id n7GLwP0s011361; Sun, 16 Aug 2009 17:58:25 -0400 (EDT) In-Reply-To: <87y6pll21u.fsf@gnu.org> X-Mailer: Apple Mail (2.936) 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:9126 Archived-At: On Aug 15, 2009, at 08:00, Ludovic Court=E8s wrote: > Hello, > > We still have troubles with the `(scm_t_int32) (x) < 0' test in > `SCM_MAKE_CHAR ()': > > --8<---------------cut here---------------start------------->8--- > ludo@gcc54:~/guile-1.9.1/+build$ cat ,,t.c > int > foo (unsigned char x) > { > return (((int)x) < 0 ? 1 : -1); > } > ludo@gcc54:~/guile-1.9.1/+build$ gcc -Wall -c ,,t.c > ,,t.c: In function =91foo=92: > ,,t.c:4: warning: comparison is always false due to limited range of =20= > data type In the case of SCM_MAKE_CHAR, both actions give identical results for =20= an input of 0, so I think just testing "x <=3D 0" will silence the =20 warning without changing the behavior. There's always the inline-function approach, too. Ken=