[Boost-bugs] [Boost C++ Libraries] #11146: iostreams seekpos/seekoff must not throw exceptions

Subject: [Boost-bugs] [Boost C++ Libraries] #11146: iostreams seekpos/seekoff must not throw exceptions
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-03-26 16:23:37


#11146: iostreams seekpos/seekoff must not throw exceptions
------------------------------+-----------------------
 Reporter: stheophil@… | Owner: turkanis
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: iostreams
  Version: Boost 1.57.0 | Severity: Problem
 Keywords: |
------------------------------+-----------------------
 Currently, `direct_streambuf<T, Tr>::seek_impl` throws `bad_seek()`
 exception on invalid input.

 The current standard draft N4296 says in section 27.8.2.4 about `seekoff`:

 ''If the positioning operation fails, or if the constructed object cannot
 represent the resultant stream position, the return value is
 pos_type(off_type(-1)).''

 At least the MSVC STL implementation does not expect pubseekoff/seekoff to
 throw, thus does not catch the exception and the bad_seek() exception may
 leak to the caller even though ios_base::exceptions() is 0.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11146>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC