[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: on the use of char
From: Frans Englich <frans.englich () telia ! com>
Date: 2004-07-29 13:58:44
Message-ID: 200407291358.44390.frans.englich () telia ! com
[Download RAW message or body]
On Thursday 29 July 2004 02:04, George Staikos wrote:
> Hi folks,
>
> I'd like to point out that we need to be careful about the use of "char"
> for storing numbers in KDE. Some platforms have unsigned char type, others
> have signed char type. I happen to have both. Consequently I have seen,
> on a regular basis, broken KDE applications on one or both of my machines
> due to code that assumes signedness or unsignedness of char. Yes, I have
> also implemented this bug before.
>
> So if your goal is to store a relatively small number and not waste
> space, can I recommend either using a bitfield int, or thinking again "is
> it really worth the possible bugs in order to save 3 bytes out of, ex.,
> ~5MB"?
>
> (really, explicitly specifying the signedness may only help half of the
> cases I've seen. don't go there...)
This is perhaps something for the Common Mistakes Doc:
http://developer.kde.org/documentation/other/mistakes.html
Frans
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic