Inconsistency in I/O packages

Mark Mitchell mark@codesourcery.com
Wed Nov 15 19:51: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.

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.

In any case, we should be consistent; we otherwise get signed
vs. unsigned warnings.

Thoughts?

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


More information about the Libstdc++ mailing list