BOOST_ASSERT() in gzip.hpp triggers clang warning -Wstring-conversion
- Dominant language
- C
- Stars
- 48
- Forks
- 124
- PR merge metrics
- No merged PRs in 30d
Description
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).
Contributor guide
No contributing guide indexed for this repository
Research direction
Open boost/iostreams/filter/gzip.hpp at line 551 and compare the nearby assertion with the project’s BOOST_ASSERT_MSG usage. Done means the gzip header no longer triggers clang’s -Wstring-conversion warning while preserving the existing bad-state assertion behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100