Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for June 20, 2013
Pencil, Pencil, and Pencil
Dividing the Linux desktop
LWN.net Weekly Edition for June 13, 2013
A report from pgCon 2013
I agree - it has utterly pointless typedefs like gchar (char is standardized by C, you know). Hiding an indirection (behind gpointer) is not nice either.
A turning point for GNU libc
Posted Apr 5, 2012 15:32 UTC (Thu) by welinder (guest, #4699)
What, exactly, is standardized about char in C?
* it's a numeric type.
* it is distinct from signed char and unsigned char, but has the same
range of values as one of the two
* it's a magic type for aliasing
* it's the element type of "foo"
char c = 0; /* valid */
char c = -1; /* valid, but might not read as -1 */
char c = 128; /* implementation dependent: either valid or undefined */
Posted Apr 5, 2012 16:33 UTC (Thu) by nybble41 (subscriber, #55106)
If you want guaranteed ranges, uint8_t and int8_t are standardized in C99 as integer types with exactly eight bits and (in the signed case) two's-complement representation. Both definitions are required unless the implementation has no compatible integer type.
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds