From bd0552e982673ba180fac11c7b3d06bb0fa7cc68 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Fri, 23 Aug 2019 13:15:25 +0200 Subject: Suppress array bounds warning when compiling generated protobuf code. --- logd/src/logd/CMakeLists.txt | 4 ++-- searchlib/src/vespa/searchlib/engine/CMakeLists.txt | 4 ++-- storageapi/src/vespa/storageapi/mbusprot/CMakeLists.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/logd/src/logd/CMakeLists.txt b/logd/src/logd/CMakeLists.txt index 49644f1b199..865d810fe0e 100644 --- a/logd/src/logd/CMakeLists.txt +++ b/logd/src/logd/CMakeLists.txt @@ -7,8 +7,8 @@ find_package(Protobuf REQUIRED) protobuf_generate_cpp(logd_PROTOBUF_SRCS logd_PROTOBUF_HDRS ../../../logserver/src/protobuf/log_protocol.proto) # protoc-generated files emit compiler warnings that we normally treat as errors. -if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set_source_files_properties(${logd_PROTOBUF_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-suggest-override") +if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") + set_source_files_properties(${logd_PROTOBUF_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-array-bounds -Wno-suggest-override") endif() vespa_add_library(logd STATIC diff --git a/searchlib/src/vespa/searchlib/engine/CMakeLists.txt b/searchlib/src/vespa/searchlib/engine/CMakeLists.txt index e0c8e3113a4..0dc183289c0 100644 --- a/searchlib/src/vespa/searchlib/engine/CMakeLists.txt +++ b/searchlib/src/vespa/searchlib/engine/CMakeLists.txt @@ -4,9 +4,9 @@ find_package(Protobuf REQUIRED) protobuf_generate_cpp(searchlib_engine_PROTOBUF_SRCS searchlib_engine_PROTOBUF_HDRS ../../../../src/protobuf/search_protocol.proto) # protoc-generated files emit compiler warnings that we normally treat as errors. -if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") +if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") set_source_files_properties(${searchlib_engine_PROTOBUF_SRCS} - PROPERTIES COMPILE_FLAGS "-Wno-suggest-override") + PROPERTIES COMPILE_FLAGS "-Wno-array-bounds -Wno-suggest-override") endif() vespa_add_library(searchlib_engine OBJECT diff --git a/storageapi/src/vespa/storageapi/mbusprot/CMakeLists.txt b/storageapi/src/vespa/storageapi/mbusprot/CMakeLists.txt index cff34afa00c..113a4372068 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/CMakeLists.txt +++ b/storageapi/src/vespa/storageapi/mbusprot/CMakeLists.txt @@ -9,8 +9,8 @@ PROTOBUF_GENERATE_CPP(storageapi_PROTOBUF_SRCS storageapi_PROTOBUF_HDRS # protoc-generated files emit compiler warnings that we normally treat as errors. # Instead of rolling our own compiler plugin we'll pragmatically disable the noise. -if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set_source_files_properties(${storageapi_PROTOBUF_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-suggest-override -Wno-inline") +if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") + set_source_files_properties(${storageapi_PROTOBUF_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-array-bounds -Wno-suggest-override -Wno-inline") endif() # protoc explicitly annotates methods with inline, which triggers -Werror=inline when # the header file grows over a certain size. -- cgit v1.2.3