[Bug libstdc++/45708] fstream reads after writes, or vice versa, don't work

2017-07-11 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45708

--- Comment #4 from Jonathan Wakely  ---
(In reply to David Krauss from comment #0)
> basic_filebuf (and therefore fstream) does not allow you to put a write
> operation directly after a read operation, or vice versa. Instead, the write
> and the read must be separated by a seek or tell (tell being equivalent to a
> seek-to-current-position).
> 
> As the Standard specifies behavior in terms of the file's contents, the
> current position in the file, and get and put areas, this requirement has no
> basis in it.

I disagree, and would have closed this as INVALID not WONTFIX.

C++14 27.9 [filebuf]:

The restrictions on reading and writing a sequence controlled by an object of
class basic_filebuf are the same as for reading and writing with
the C standard library FILEs.

C11 7.21.5.3:

When a file is opened with update mode ('+' as the second or third character in
the above list of mode argument values), both input and output may be performed
on the associated stream. However, output shall not be directly followed by
input without an intervening call to the fflush function or to a file
positioning function (fseek, fsetpos, or rewind), and input shall not be
directly followed by output without an intervening call to a file positioning
function, unless the input operation encounters end-of-file.

[Bug libstdc++/45708] fstream reads after writes, or vice versa, don't work

2010-09-17 Thread paolo dot carlini at oracle dot com


--- Comment #1 from paolo dot carlini at oracle dot com  2010-09-17 19:03 
---
Not going to happen, at least not until the very far future, in the occasion of
an ABI bump or a global redesign.


-- 

paolo dot carlini at oracle dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||WONTFIX


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45708



[Bug libstdc++/45708] fstream reads after writes, or vice versa, don't work

2010-09-17 Thread potswa at mac dot com


--- Comment #2 from potswa at mac dot com  2010-09-17 19:09 ---
ABI bump? Would this require additional data members? I would think it requires
less.

Isn't this at least a duplicate of something?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45708



[Bug libstdc++/45708] fstream reads after writes, or vice versa, don't work

2010-09-17 Thread paolo dot carlini at oracle dot com


--- Comment #3 from paolo dot carlini at oracle dot com  2010-09-17 19:12 
---
This is a major redesign in any case, which would change completely the user
experience. Again, please analyze carefully all the discussions which led to
the current design (possibly get in contact with Nathan too), analyze the
performance in the various circumstances, then we can reconsider those issues.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45708