[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Use of @encode(char) not portable.
From: |
Richard Frith-Macdonald |
Subject: |
Re: Use of @encode(char) not portable. |
Date: |
Tue, 8 May 2001 09:02:47 +0100 |
On Monday, May 7, 2001, at 04:29 AM, Adam Fedor wrote:
I've encountered a bug in the coding functions of the base library
(perhaps others). @encode(char) is used in several places, but this is
not portable. @encode(char) returns an unsigned char (_C_UCHR) on some
machines and signed (_C_CHR) on others. It's easy to change all
occurances to @encode(unsigned char), but I'm not sure how many people
this will mess up. I'm not sure if it's worth the trouble though to
create a new encoding version in every class it's needed.
The other choice is to make the decoder a tad more forgiving...
I think perhaps we should replace all occurrences of @encode(char) with
@encode(signed char) ... since all the other types are consistent in that
omitting the signed/unsigned qualifier implies signed.
Making the decoders more tolerant also sounds like a good idea ...
perhaps
we should do both?