Unverified Commit bbc90388 authored by Simon Giesecke's avatar Simon Giesecke Committed by GitHub

Merge pull request #3140 from bluca/clang_tautological

Problem: build broken with clang 6 on Android NDK 17
parents 2d1bb07f 58d13395
...@@ -35,6 +35,18 @@ if(COMPILER_SUPPORTS_C11) ...@@ -35,6 +35,18 @@ if(COMPILER_SUPPORTS_C11)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
endif() endif()
if(NOT MSVC)
# clang 6 has a warning that does not make sense on multi-platform code
CHECK_CXX_COMPILER_FLAG("-Wno-tautological-constant-compare" CXX_HAS_TAUT_WARNING)
if(CXX_HAS_TAUT_WARNING)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-tautological-constant-compare")
endif()
CHECK_C_COMPILER_FLAG("-Wno-tautological-constant-compare" CC_HAS_TAUT_WARNING)
if(CC_HAS_TAUT_WARNING)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-tautological-constant-compare")
endif()
endif()
# Will be used to add flags to pkg-config useful when apps want to statically link # Will be used to add flags to pkg-config useful when apps want to statically link
set (pkg_config_libs_private "") set (pkg_config_libs_private "")
......
...@@ -812,6 +812,12 @@ AM_CONDITIONAL([WITH_CLANG_FORMAT], [$WITH_CLANG_FORMAT]) ...@@ -812,6 +812,12 @@ AM_CONDITIONAL([WITH_CLANG_FORMAT], [$WITH_CLANG_FORMAT])
# unittests will not build without the static libzmq.a # unittests will not build without the static libzmq.a
AM_CONDITIONAL(ENABLE_STATIC, test "x$enable_static" = "xyes") AM_CONDITIONAL(ENABLE_STATIC, test "x$enable_static" = "xyes")
# clang 6 has a warning that does not make sense on multi-platform code
AX_CHECK_COMPILE_FLAG([-Wno-tautological-constant-compare],
[CFLAGS+=" -Wno-tautological-constant-compare" CXXFLAGS+=" -Wno-tautological-constant-compare"],
[],
[-Werror])
# Subst LIBZMQ_EXTRA_CFLAGS & CXXFLAGS & LDFLAGS # Subst LIBZMQ_EXTRA_CFLAGS & CXXFLAGS & LDFLAGS
AC_SUBST(LIBZMQ_EXTRA_CFLAGS) AC_SUBST(LIBZMQ_EXTRA_CFLAGS)
AC_SUBST(LIBZMQ_EXTRA_CXXFLAGS) AC_SUBST(LIBZMQ_EXTRA_CXXFLAGS)
......
...@@ -255,7 +255,7 @@ zmq::fd_t zmq::tipc_connecter_t::connect () ...@@ -255,7 +255,7 @@ zmq::fd_t zmq::tipc_connecter_t::connect ()
// Following code should handle both Berkeley-derived socket // Following code should handle both Berkeley-derived socket
// implementations and Solaris. // implementations and Solaris.
int err = 0; int err = 0;
#if ZMQ_HAVE_VXWORKS #ifdef ZMQ_HAVE_VXWORKS
int len = sizeof (err); int len = sizeof (err);
#else #else
socklen_t len = sizeof (err); socklen_t len = sizeof (err);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment