From: Kefu Chai Date: Mon, 14 Jan 2019 03:26:25 +0000 (+0800) Subject: cmake: silence -Wsign-compare in libfmt X-Git-Tag: v14.1.0~356^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3aa8d90b36d16cb395f56493c5c2a5873b5a034f;p=ceph.git cmake: silence -Wsign-compare in libfmt * silence -Wsign-compare in libfmt * silence -Wattributes in seastar to silence warnings like: /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/seastar/fmt/include/fmt/format.h: In instantiation of 'constexpr bool fmt::v5::internal::find(Ptr, Ptr, T, Ptr&) [with bool IS_CONSTEXPR = false; T = char; Ptr = const wchar_t*]': /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/seastar/fmt/include/fmt/format.h:2154:32: required from 'constexpr void fmt::v5::internal::parse_format_string(fmt::v5::basic_string_view, Handler&&)::writer::operator()(const Char*, const Char*) [with bool IS_CONSTEXPR = false; Char = wchar_t; Handler = fmt::v5::format_handler > >, wchar_t, fmt::v5::basic_format_context >, wchar_t> >&]' /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/seastar/fmt/include/fmt/format.h:2164:3: required from 'constexpr void fmt::v5::internal::parse_format_string(fmt::v5::basic_string_view, Handler&&) [with bool IS_CONSTEXPR = false; Char = wchar_t; Handler = fmt::v5::format_handler > >, wchar_t, fmt::v5::basic_format_context >, wchar_t> >&]' /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/seastar/fmt/include/fmt/format.h:3346:39: required from 'typename Context::iterator fmt::v5::vformat_to(typename ArgFormatter::range, fmt::v5::basic_string_view, fmt::v5::basic_format_args) [with ArgFormatter = fmt::v5::arg_formatter > >; Char = wchar_t; Context = fmt::v5::basic_format_context >, wchar_t>; typename Context::iterator = std::back_insert_iterator >; typename ArgFormatter::range = fmt::v5::back_insert_range >]' /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/seastar/fmt/include/fmt/format.h:3457:64: required from here /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/seastar/fmt/include/fmt/format.h:2120:14: error: comparison of integer expressions of different signedness: 'const wchar_t' and 'char' [-Werror=sign-compare] if (*out == value) ~~~~~^~~~~~~~ cc1plus: all warnings being treated as errors where libfmt compares a wchar_t with a literal '}', which is char. because the former is unsigned, and the latter is of a signed type, GCC is annoyed. but since both of them are ASCII, and when performing comparison, the signed one is converted to unsigned, then result of comparison is correct per-se. hence, it's safe to silence this very warning. and warning like: /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/seastar/src/core/future-util.cc:61:5: required from 'seastar::future<> seastar::sleep_abortable(typename Clock::duration, seastar::abort_source&) [with Clock = std::chrono::_V2::steady_clock; typename Clock::duration = std::chrono::duration >]' /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/seastar/src/core/future-util.cc:68:105: required from here /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/seastar/src/core/future-util.cc:48:28: error: 'seastar::sleep_abortable(typename Clock::duration, seastar::abort_source&)::sleeper::sleeper(typename Clock::duration, seastar::abort_source&) [with Clock = std::chrono::_V2::steady_clock; typename Clock::duration = std::chrono::duration >]::' declared with greater visibility than the type of its field 'seastar::sleep_abortable(typename Clock::duration, seastar::abort_source&)::sleeper::sleeper(typename Clock::duration, seastar::abort_source&) [with Clock = std::chrono::_V2::steady_clock; typename Clock::duration = std::chrono::duration >]::::' [-Werror=attributes] : tmr([this] { done.set_value(); }) { ^ Signed-off-by: Kefu Chai --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6d7a00afe463..b9507eaaa614 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -295,6 +295,7 @@ if(WITH_SEASTAR) endmacro () set(Seastar_HWLOC OFF CACHE BOOL "" FORCE) set(Seastar_STD_OPTIONAL_VARIANT_STRINGVIEW ON CACHE BOOL "" FORCE) + set(Seastar_CXX_FLAGS "-Wno-sign-compare;-Wno-attributes" CACHE STRING "" FORCE) add_subdirectory(seastar) # create the directory so cmake won't complain when looking at the imported # target: Seastar exports this directory created at build-time