Fix clang -Wtautological-type-limit-compare warnings.#155
Open
Romain-Geissler-1A wants to merge 1 commit intoboostorg:developfrom
Open
Conversation
In file included from /data/mwrep/res/osp/Boost/23-0-0-0/include/boost/iostreams/filtering_streambuf.hpp:17:
In file included from /data/mwrep/res/osp/Boost/23-0-0-0/include/boost/iostreams/chain.hpp:28:
In file included from /data/mwrep/res/osp/Boost/23-0-0-0/include/boost/iostreams/detail/push.hpp:24:
In file included from /data/mwrep/res/osp/Boost/23-0-0-0/include/boost/iostreams/detail/resolve.hpp:19:
In file included from /data/mwrep/res/osp/Boost/23-0-0-0/include/boost/iostreams/detail/adapter/mode_adapter.hpp:24:
In file included from /data/mwrep/res/osp/Boost/23-0-0-0/include/boost/iostreams/operations.hpp:16:
In file included from /data/mwrep/res/osp/Boost/23-0-0-0/include/boost/iostreams/close.hpp:19:
In file included from /data/mwrep/res/osp/Boost/23-0-0-0/include/boost/iostreams/detail/adapter/non_blocking_adapter.hpp:13:
/data/mwrep/res/osp/Boost/23-0-0-0/include/boost/iostreams/seek.hpp:86:20: error: result of comparison 'boost::iostreams::stream_offset' (aka 'long') > 9223372036854775807 is always
false [-Werror,-Wtautological-type-limit-compare]
off > integer_traits<std::streamoff>::const_max ) )
~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/data/mwrep/res/osp/Boost/23-0-0-0/include/boost/iostreams/seek.hpp:85:20: error: result of comparison 'boost::iostreams::stream_offset' (aka 'long') < -9223372036854775808 is always false [-Werror,-Wtautological-type-limit-compare]
( off < integer_traits<std::streamoff>::const_min ||
~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/data/mwrep/res/osp/Boost/23-0-0-0/include/boost/iostreams/seek.hpp:113:20: error: result of comparison 'boost::iostreams::stream_offset' (aka 'long') > 9223372036854775807 is always false [-Werror,-Wtautological-type-limit-compare]
off > integer_traits<std::streamoff>::const_max ) )
~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/data/mwrep/res/osp/Boost/23-0-0-0/include/boost/iostreams/seek.hpp:112:20: error: result of comparison 'boost::iostreams::stream_offset' (aka 'long') < -9223372036854775808 is always false [-Werror,-Wtautological-type-limit-compare]
( off < integer_traits<std::streamoff>::const_min ||
~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 errors generated.
Member
|
|
Contributor
|
What platform (compiler, standard library) are you using? |
Contributor
Author
|
This happened with clang 15 (so a release version) which was using glibc headers (the future 2.37 release, I think when I posted this pull request I used a snapshot of the master branch as of mid december) and libstdc++ headers (the future gcc 13 release, also a snapshot as of mid december). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: I am not sure this check on the offset is valid in the first place, I don't know how possible it is that
stream_offsetis a different type thanstd::streamoffin which case this check is totally pointless as always false.