summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-01-29 13:39:26 +0100
committerTor Egge <Tor.Egge@online.no>2023-01-29 13:39:26 +0100
commit3efd154e4ed8094b0071bb2a2373f707935ae0d2 (patch)
tree4b9d66a20ee779589f9cc50ce3bb56ef8dc70092
parentcbe4909b5d23dcee552d6777733387966053d25a (diff)
Disable maybe-uninitialized warning when compiling with address santizer.
-rw-r--r--build_settings.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/build_settings.cmake b/build_settings.cmake
index 91ee4c47b81..718e0fd6323 100644
--- a/build_settings.cmake
+++ b/build_settings.cmake
@@ -33,6 +33,11 @@ else()
set(C_WARN_OPTS "-Winline ${C_WARN_OPTS}")
endif()
if (VESPA_USE_SANITIZER)
+ if (VESPA_USE_SANITIZER STREQUAL "address" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0)
+ # Turn off maybe uninitialized and restrict warnings when compiling with
+ # address sanitizer on gcc 12 or newer.
+ set(C_WARN_OPTS "${C_WARN_OPTS} -Wno-maybe-uninitialized -Wno-restrict")
+ endif()
if (VESPA_USE_SANITIZER STREQUAL "thread" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0)
# Turn off warning about std::atomic_thread_fence not being supported by
# address sanitizer.