[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
unsigned char confusion
From: |
Greg Troxel |
Subject: |
unsigned char confusion |
Date: |
Tue, 11 Aug 2009 09:39:34 -0400 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/22.3 (berkeley-unix) |
In srfi-13.c line 25222, SCM_MAKE_CHAR is called with an argument that
is an unsigned char. This leads to:
cc1: warnings being treated as errors
srfi-13.c: In function 'string_titlecase_x':
srfi-13.c:2522: warning: comparison is always false due to limited range of
data type
srfi-13.c:2522: warning: comparison is always false due to limited range of
data type
This is because SCM_MAKE_CHAR (in libguile/chars.h) has a bizarre
conditional that checks the argument for < 0, and if so casts it to
unsigned char. Otherwise it does not cast. There is no comment that
explains what the point is. Fairly obviously this is an attempt to
avoid sign extension during SCM_MAKE_ITAG8. The value is then cast to
uintptr_t which is also unsigned, but sign extension would set more
bits.
So, I think the cast to unsigned char should just always be there, without the
test.
pgpfr5oKombS6.pgp
Description: PGP signature
- Re: i guess we're frozen & stuff, (continued)
- Re: i guess we're frozen & stuff, Greg Troxel, 2009/08/11
- Re: i guess we're frozen & stuff, Greg Troxel, 2009/08/11
- i18n issues on NetBSD, Ludovic Courtès, 2009/08/11
- Re: i18n issues on NetBSD, Greg Troxel, 2009/08/11
- Re: i18n issues on NetBSD, Ludovic Courtès, 2009/08/11
Re: i guess we're frozen & stuff, Mike Gran, 2009/08/11
Re: i guess we're frozen & stuff, Juhani Viheräkoski, 2009/08/11
Re: i guess we're frozen & stuff, Greg Troxel, 2009/08/11
unsigned char confusion,
Greg Troxel <=
Re: i guess we're frozen & stuff, Ken Raeburn, 2009/08/11