on the use of char
George Staikos
staikos at kde.org
Thu Jul 29 03:04:32 BST 2004
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...)
--
George Staikos
KDE Developer http://www.kde.org/
Staikos Computing Services Inc. http://www.staikos.net/
More information about the kde-core-devel
mailing list