[RFC/Patch] libstdc++/14320 aka class type streamoff doesn't work :(
Pétur Runólfsson
peturr02@ru.is
Mon Mar 1 13:00:00 GMT 2004
Paolo Carlini wrote:
> Thus the below: it seems to me that the best we can do for streamoff is
> essentially returning to what we had in 3_3. This implies giving away
> some type safety (i.e., some QoI) and also that the issue with LFS is
> still there, but otherwise seems OK. On glibc platforms we get an XPASS,
> since int64t is actually a typedef for long long.
This patch seems reasonable to me given the current release plan for
3.4.
A minor nitpick:
@@ -204,7 +111,7 @@
// conversion. In this implementation this constructor stores
// the integer as the offset and default constructs the state.
/// Construct position from integer.
- fpos(__streamoff_base_type __off)
+ fpos(int __off)
: _M_off(__off), _M_state() { }
// The standard requires that fpos objects can be constructed
@@ -214,9 +121,12 @@
// constructor stores the streamoff as the offset and default
// constructs the state.
/// Construct position from offset.
- fpos(const streamoff& __off)
+ fpos(streamoff __off)
: _M_off(__off), _M_state() { }
If streamoff is an integral type, it should be sufficient to have only
the second constructor.
> What do you think? Disabling at build time LFS, I don't believe this is
> an option,
I agree.
Regards,
Petur
More information about the Libstdc++
mailing list