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

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



Emile van Bergen <emile-deb@evbergen.xs4all.nl> writes:

> Hi,
> 
> On Tue, Nov 19, 2002 at 01:48:21PM -0600, Steve Greenland wrote:
> 
> > If, for some weird reason, you absolutely must have a signed 8-bit
> > arithmetic type, the proper type is 'int8_t' (found in 'stdint.h'[1]).
> > Not char. Not signed char[2].
> 
> I agree, but I'm willing to bet that assuming sizeof(char) is 1 is more
> portable today than assuming stdint.h is available.
> 
> But the point is: if a particular size or signedness is required for a
> variable, then its type name should make that clear.
> 
> A gchar is about as undescriptive as you can get; uint8 would have been
> so much better. Glib could perfectly have used autoconf to sort out how
> to define or typedef a [u]int{8,16,32,ptr,64} using the standard C types
> on a certain platform if it really needed them.
> 
They do: take a look at /usr/lib/glib-2.0/include/glibconfig.h

There you have gint8, guint8, gint16, ...

Please stop ranting about things you seem not to be informed of.

Andy
-- 
Andreas Rottmann         | Dru@ICQ        | 118634484@ICQ | a.rottmann@gmx.at
http://www.8ung.at/rotty | GnuPG Key: http://www.8ung.at/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62



Reply to: