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

Fix clang -Wtautological-type-limit-compare warnings. #155

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions include/boost/iostreams/seek.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ struct seek_impl_basic_ios {
BOOST_IOS::seekdir way,
BOOST_IOS::openmode which )
{
#if defined(BOOST_CLANG)
# pragma clang diagnostic push
# if defined(__has_warning)
# if __has_warning("-Wtautological-type-limit-compare")
# pragma clang diagnostic ignored "-Wtautological-type-limit-compare"
# endif
# endif
#endif
if ( way == BOOST_IOS::beg &&
( off < integer_traits<std::streamoff>::const_min ||
off > integer_traits<std::streamoff>::const_max ) )
Expand All @@ -90,6 +98,9 @@ struct seek_impl_basic_ios {
return t.rdbuf()->pubseekoff(off, way, which);
}
}
#if defined(BOOST_CLANG)
# pragma clang diagnostic pop
#endif
};

template<>
Expand All @@ -108,6 +119,14 @@ struct seek_device_impl<streambuf_tag> {
BOOST_IOS::seekdir way,
BOOST_IOS::openmode which )
{
#if defined(BOOST_CLANG)
# pragma clang diagnostic push
# if defined(__has_warning)
# if __has_warning("-Wtautological-type-limit-compare")
# pragma clang diagnostic ignored "-Wtautological-type-limit-compare"
# endif
# endif
#endif
if ( way == BOOST_IOS::beg &&
( off < integer_traits<std::streamoff>::const_min ||
off > integer_traits<std::streamoff>::const_max ) )
Expand All @@ -117,6 +136,9 @@ struct seek_device_impl<streambuf_tag> {
return t.BOOST_IOSTREAMS_PUBSEEKOFF(off, way, which);
}
}
#if defined(BOOST_CLANG)
# pragma clang diagnostic pop
#endif
};

template<>
Expand Down