This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
RE: [Patch] Fix libstdc++/11378 (take2) + xsputn optmizations
- From: Pétur Runólfsson <peturr02 at ru dot is>
- To: "Andreas Jaeger" <aj at suse dot de>
- Cc: "Paolo Carlini" <pcarlini at unitus dot it>,<libstdc++ at gcc dot gnu dot org>
- Date: Tue, 8 Jul 2003 20:31:20 -0000
- Subject: RE: [Patch] Fix libstdc++/11378 (take2) + xsputn optmizations
Andreas Jaeger wrote:
> off64_t is not available everywhere - and int64_t might not be
> available everywhere also.
Thanks for the info.
>> The issue here is ABI stability; if a platform doesn't have large file
>> support now, but gets it in the future it should be possible to enable
>> large file support in basic_filebuf without breaking the ABI.
>
> My point here is type safety, we should use the proper types and not
> invent some int64_t that works today but breaks in the future
Indeed - that's why we have streamoff.
> (remember when everybody used long instead of off_t - or even int?
No :^)
> That makes it quite difficult to convert programs to off64_t).
Users of iostreams (and the library itself) should use streamoff
everywhere - the problem is to find a type for streamoff that can
be used for the forseeable future (the next decade or so) - which
probably means at least 64 bits for all platforms.
It may be safe to use
typedef long long streamoff;
If sizeof(long long) changes, binary compatibility is lost anyway
so changing the definition is OK; and it is only one line of code
that needs to change so that's not much of an issue either.
Petur