This is the mail archive of the 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]
Other format: [Raw text]

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.


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