On Tue, 3 Apr 2007, Schwarz, Konrad wrote: SK>> -----Original Message----- SK>> From: Geoff Clare [mailto:[EMAIL PROTECTED] SK>> Sent: Monday, April 02, 2007 10:22 AM SK>> To: bug-gnulib; Matthew Woehlke; [EMAIL PROTECTED] SK>> Subject: Re: source(builtin) and read(2) SK> SK>> I'll submit a defect report. SK> SK>Perhaps it would be possible to typedef ssize_t to ptrdiff_t at the same SK>time (or eliminate ssize_t alltogether). SK> SK>There does not seem to be any worthwhile reason for separating the two: SK>The only technical reason given for the existance of ssize_t is the SK>ability to alias it with size_t when processing arguments with SK><stdarg.h> -- which I consider of marginal importance at best; the C SK>standards committee has certainly not made ssize_t part of the C SK>standard. SK> SK>The argument that since ptrdiff_t is intended to represent the SK>difference of pointers makes it somehow unsuitable to represent the SK>result of read()/write() is missing the point: on any useful ABI, SK>ptrdiff_t can represent the size of any object, can represent 0, and can SK>represent -1, which is what read() and cousins require.
Please keep in mind, that ssize_t exists for a long time. It was already in sys/types.h Rev. 8.4 (1/21/94) of the BSD code (Rev. 1.1 of FreeBSDs types.h). I don't have the BSD repo at hand to track that back in the original sources. It is used all over the places so eliminating is is hardly a good idea. This would also have influence on printf's %z and so on. harti