[PATCH 64bit] ssize_t

Eric Blake eblake@redhat.com
Wed Feb 20 16:16:00 GMT 2013


On 02/20/2013 08:17 AM, Corinna Vinschen wrote:

>> GCC requires exact symmetry of types between ssize_t and size_t.
>> I.e. checking for sizes of types is not sufficient for [s]size_t.
> 
> Do you have a code suggestion then?  GCC doesn't define ssize_t
> by itself, nor in stddef.h except for BeOS.  And the only predefines
> helping us are
> 
>   #define __SIZE_MAX__ 18446744073709551615UL
>   #define __SIZEOF_INT__ 4
>   #define __SIZEOF_LONG__ 8
>   #define __SIZEOF_SIZE_T__ 8
>   #define __SIZE_TYPE__ long unsigned int

There's the key.  But how to make gcc tell us the corresponding signed
type?  Can we write something that relies on __builtin_types_compatible_p?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/newlib/attachments/20130220/f751b79a/attachment.sig>


More information about the Newlib mailing list