From fb8cb8968fa28c3b3e943cb86dbe5c57d97ea422 Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Thu, 15 Aug 2019 19:09:24 -0500 Subject: [PATCH] ARROW-6259: [C++] Add -Wno-extra-semi-stmt when compiling with clang 8 to work around Flatbuffers bug, suppress other new LLVM 8 warnings LLVM 8 introduces `-Wextra-semi-stmt` and Flatbuffers generates code with superfluous semicolons (upstream bug report https://github.com/google/flatbuffers/issues/5482). This is breaking our macOS builds for the last few hours because conda-forge upgraded their compiler toolchain from Apple clang 4.0.1 to clang 8.0.0 this afternoon. Closes #5096 from wesm/ARROW-6259 and squashes the following commits: 96cbba9e8 Suppress -Wshadow-field and -Wc++2a-compat also 686339caf Add -Wno-extra-semi-stmt when compiling with clang 8 to work around Flatbuffers bug Authored-by: Wes McKinney Signed-off-by: Wes McKinney --- cpp/cmake_modules/SetupCxxFlags.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake b/cpp/cmake_modules/SetupCxxFlags.cmake index 9eba9e8cfd1f4..09d5bf2f2d455 100644 --- a/cpp/cmake_modules/SetupCxxFlags.cmake +++ b/cpp/cmake_modules/SetupCxxFlags.cmake @@ -168,6 +168,15 @@ if("${BUILD_WARNING_LEVEL}" STREQUAL "CHECKIN") if("${COMPILER_VERSION}" VERSION_GREATER "3.9") set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-zero-as-null-pointer-constant") endif() + + if("${COMPILER_VERSION}" VERSION_GREATER "7.0") + # ARROW-6259: Flatbuffers generates code with superfluous semicolons, so + # we suppress this warning for now. See upstream bug report + # https://github.com/google/flatbuffers/issues/5482 + set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-extra-semi-stmt \ +-Wno-shadow-field -Wno-c++2a-compat") + endif() + set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-unknown-warning-option") elseif("${COMPILER_FAMILY}" STREQUAL "gcc") set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wall \