boostorg / iostreams

Boost.org iostreams module
http://boost.org/libs/iostreams
Boost Software License 1.0
43 stars 116 forks source link

C4706 MSVC warning in zlib.hpp #131

Closed akortunov closed 2 years ago

akortunov commented 3 years ago

Happens at least with Boost 1.76 release or lower. If you build a C++ project which includes Boost's zlib.hpp with /W4 warnings level, you may get a such warning:

boost\iostreams\filter\zlib.hpp(392): warning C4706: assignment within conditional expression

It is caused by this code from the include/boost/iostreams/filter/zlib.hpp:

return !(eof_ = result == zlib::stream_end);

There are at least two possible solutions for this issue:

  1. Add 4706 to the list of disabled warnings in this file:
    #ifdef BOOST_MSVC
    # pragma warning(push)
    # pragma warning(disable:4251 4275 4231 4660 4706)
    #endif
  2. Split this expression:
    eof_ = (result == zlib::stream_end);
    return !eof_;
rdoeffinger commented 2 years ago

Looks like this was fixed, anyone able to close?