[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] Re: Bug#169450: wrong assumption on char signedness



Hi,

On Tue, Nov 19, 2002 at 10:33:39AM -0600, Steve Greenland wrote:

> On 18-Nov-02, 15:37 (CST), Andreas Rottmann <a.rottmann@gmx.at> wrote: 
> > "H. S. Teoh" <hsteoh@quickfur.yi.org> writes:
> > from glib/gtypes.h:
> > 
> > ------<snip>--------
> > typedef char   gchar;
> > 
> > typedef unsigned char   guchar;
> > ------<snap>--------
> > 
> > So gchar is supposed to behave exactly like char.
> 
> Which means that smurf needs to decide what it wants: a char variable or
> a variable capable of holding (small?) positive and negative integers.
> The two concepts are not interchangeable. Unless there are real memory
> limits involved, just declare the damned thing 'int' and be happy. Or,
> stop trying to store negative values in char, that's not what it's for.

Or just declare it explicitly as a signed char.

Cheers,


Emile.

-- 
E-Advies / Emile van Bergen   |   emile@e-advies.info
tel. +31 (0)70 3906153        |   http://www.e-advies.info

Attachment: pgpP06P6Thfhu.pgp
Description: PGP signature


Reply to: