This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


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

Re: Inconsistency in I/O packages


> 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

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