Skip to content

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

Description

@pkl97

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions