This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 64bit] ssize_t


On 02/20/2013 10:40 AM, Joseph S. Myers wrote:
> On Wed, 20 Feb 2013, Ralf Corsepius wrote:
> 
>> GCC requires exact symmetry of types between ssize_t and size_t.
> 
> GCC does not know or care about ssize_t; it's not an ISO C type.  POSIX, 
> which defines ssize_t, does not require it to be the signed type 
> corresponding to size_t.

POSIX requires that printf("%zd", value) treat value as the
corresponding signed integer type that matches with size_t; not that it
treat value as ssize_t.  But while I agree that you could technically
make ssize_t NOT be the same size as size_t and still comply with POSIX,
I claim that any implementation this lame is violating a lot of
programmer expectations, and that in practice, "%zd" should work with
ssize_t, rather than just the lame POSIX cop-out wording of the 'signed
integer type corresponding to a size_t'.

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

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]