iostreams icon indicating copy to clipboard operation
iostreams copied to clipboard

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

Open pkl97 opened this issue 1 year ago • 0 comments

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).

pkl97 avatar Oct 29 '23 10:10 pkl97