Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pkl97 opened this issue Oct 29, 2023 · 0 comments
Open

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

pkl97 opened this issue Oct 29, 2023 · 0 comments

Comments

@pkl97
Copy link

pkl97 commented Oct 29, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant