boostorg / iostreams

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

BOOST_ASSERT() in gzip.hpp triggers clang warning -Wstring-conversion #168

Open pkl97 opened 11 months ago

pkl97 commented 11 months ago

boost/iostreams/filter/gzip.hpp, line 551: BOOST_ASSERT(!"Bad state");

This line triggers a -Wstring-conversion warning:

boost/iostreams/filter/gzip.hpp:551:31: warning: implicit conversion turns string literal into bool: 'const char[10]' to 'bool' [-Wstring-conversion]

Would it be possible to use BOOST_ASSERT_MSG(false,"Bad state"); instead?

This would make it easier to enable the warning in projects that use Boost.IOStreams.

Btw: Most Boost code uses BOOST_ASSERT_MSG() nowadays (240 hits), the use of BOOST_ASSERT(!...) is not widespread (only 9 hits).