I think the problem is that the routine in question is fundamentally
written to assume a signed input. Perhaps there should be an unsigned
version that takes unsigned chars, and perhaps guile should explicit
declare characters as one or the other. Or perhaps just always cast to
unsigned char - i
> From: carlo.bramix
>
> 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
Date : Tue, 18 Aug 2009 10:32:29 -0700 (PDT)
Subject : Re: `SCM_MAKE_CHAR ()' signedness issue
> > From: Ludovic Courtès
> > To: guile-devel@gnu.org
> > Sent: Monday, August 17, 2009 8:33:03 AM
> > Subject: Re: `SCM_MAKE_CHAR ()' signedness issue
> >
> From: Ludovic Courtès
> 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. If the comparison is
On Aug 17, 2009, at 14:52, carlo.bramix wrote:
Hello,
if I understood the problem, I think it can be easily fixed without
using an inline function.
For example:
#ifdef __GNUC__
Relying on GCC-specific syntax is probably worse than an inline
function. Part of Ludovic's complaint was that
itten.
Sincerely,
Carlo Bramini.
-- Initial Header ---
>From : guile-devel-bounces+carlo.bramix=libero...@gnu.org
To : guile-devel@gnu.org
Cc :
Date : Mon, 17 Aug 2009 17:33:03 +0200
Subject : Re: `SCM_MAKE_CHAR ()' signedness issue
> Mike Gran
Mike Gran writes:
> On my system I ran a test with SCM_MAKE_CHAR as a macro, an an inline,
> and as a never inlined function. I ran ./check-guile twice for each.
You're cheating! ;-)
The test suite does lots of things besides calling `SCM_MAKE_CHAR ()',
so I'm not sure if it's a good benchmar
Hi-
On Mon, 2009-08-17 at 10:26 +0200, Ludovic Courtès wrote:
> Hi,
>
> Ken Raeburn writes:
>
> > On Aug 16, 2009, at 18:13, Ludovic Courtès wrote:
> >>> There's always the inline-function approach, too.
> >>
> >> Unfortunately no, because we're still not assuming `inline' keyword
> >> support
Hi,
Ken Raeburn writes:
> On Aug 16, 2009, at 18:13, Ludovic Courtès wrote:
>>> There's always the inline-function approach, too.
>>
>> Unfortunately no, because we're still not assuming `inline' keyword
>> support from the compiler.
>
> Right, but inline.h deals with that; if "inline" isn't sup
On Aug 16, 2009, at 18:13, Ludovic Courtès wrote:
There's always the inline-function approach, too.
Unfortunately no, because we're still not assuming `inline' keyword
support from the compiler.
Right, but inline.h deals with that; if "inline" isn't supported you
just get a declaration and
Ken Raeburn writes:
> In the case of SCM_MAKE_CHAR, both actions give identical results for
> an input of 0, so I think just testing "x <= 0" will silence the
> warning without changing the behavior.
Oh, good point.
> There's always the inline-function approach, too.
Unfortunately no, because
On Aug 15, 2009, at 08:00, Ludovic Courtès wrote:
Hello,
We still have troubles with the `(scm_t_int32) (x) < 0' test in
`SCM_MAKE_CHAR ()':
--8<---cut here---start->8---
l...@gcc54:~/guile-1.9.1/+build$ cat ,,t.c
int
foo (unsigned char x)
{
return (((int)x)
Hello,
We still have troubles with the `(scm_t_int32) (x) < 0' test in
`SCM_MAKE_CHAR ()':
--8<---cut here---start->8---
l...@gcc54:~/guile-1.9.1/+build$ cat ,,t.c
int
foo (unsigned char x)
{
return (((int)x) < 0 ? 1 : -1);
}
l...@gcc54:~/guile-1.9.1/+build$
13 matches
Mail list logo