Open PHackett opened 1 year ago
I think the proper solution here is likely the following on lines 129, 130:
else if(way != ::std::ios_base::cur || (which & ::std::ios_base::in) )
// (altering in&out is only supported if way is beg or end, not cur)
Similar to the logic on lines 110, 111:
else if(way != ::std::ios_base::cur || (which & ::std::ios_base::out) )
// (altering in&out is only supported if way is beg or end, not cur)
@PHackett any thoughts on this approach?
This was spotted by a static code analyser in an old version of boost - it was fixed in a later version. I suggest that you look at newer versions of the library to see what fix was applied.
https://github.com/boostorg/format/blob/78ef371d2d90462671b90c3af407fae07820b193/include/boost/format/alt_sstream_impl.hpp#L127
Line 127 is - else if(way == ::std::ios_base::beg)
It is followed on line 129 - else if(way != ::std::ios_base::beg)
Which, of course is always true given the previous test. This "impossible-redundant-condition" was spotted by a source analyser I used.