Inconsistency in I/O packages

Benjamin Kosnik bkoz@redhat.com
Wed Nov 15 20:18:00 GMT 2000


> In c_io_stdio.h we have:
> 
>   typedef size_t        streamsize; // Signed integral type
> 
> That's false: it's unsigned.  And, in c_io_libio.h, we have:
> 
>   typedef _IO_ssize_t   streamsize;
> 
> Presumably we should be using ptrdiff_t in c_io_stdio.h?  That's the
> stanard C type likely to be the signed equivalent of size_t.

They should be consistent, as you say. Most likely, this is a bug in the 
newer file, c_io_stdio.h. I think changing it to ptrdiff_t (or int) should 
work.

> On the other hand, why should we be using a signed type for streamsize
> at all?  I would have that we would use unsigned for streamsize, and
> signed for streamoff.

27.4.1

"streamsize is a synonym for one of the signed basic integral types."

-benjamin


More information about the Libstdc++ mailing list