guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

`SCM_MAKE_CHAR ()' signedness issue


From: Ludovic Courtès
Subject: `SCM_MAKE_CHAR ()' signedness issue
Date: Sat, 15 Aug 2009 14:00:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hello,

We still have troubles with the `(scm_t_int32) (x) < 0' test in
`SCM_MAKE_CHAR ()':

--8<---------------cut here---------------start------------->8---
address@hidden:~/guile-1.9.1/+build$ cat ,,t.c
int
foo (unsigned char x)
{
  return (((int)x) < 0 ? 1 : -1);
}
address@hidden:~/guile-1.9.1/+build$ gcc -Wall -c ,,t.c
,,t.c: In function ‘foo’:
,,t.c:4: warning: comparison is always false due to limited range of data type
address@hidden:~/guile-1.9.1/+build$ ../build-aux/config.guess 
sparc64-unknown-linux-gnu
address@hidden:~/guile-1.9.1/+build$ gcc --version
gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--8<---------------cut here---------------end--------------->8---

The problem occurs, e.g., in `string_titlecase_x ()'.

Surprisingly, GCC 4.4 on x86_64-linux-gnu doesn't yield any warning for
the example above.

I'm not sure how to fix it, so we'll see for the next release.

Thanks,
Ludo'.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]