diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-01-29 15:02:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-29 15:02:33 +0100 |
commit | ef4ef1ede9979a8bf6c581e3cb79d577cf501f75 (patch) | |
tree | c57bd0e3f7d6a7439dbaba48773e5f3a28a1df77 | |
parent | f8ae7ad4dd02149082286ceed8b1682b93e2e3da (diff) | |
parent | 3efd154e4ed8094b0071bb2a2373f707935ae0d2 (diff) |
Merge pull request #25782 from vespa-engine/toregge/disable-maybe-uninitialized-warning-when-compiling-with-address-sanitizer
Disable maybe-uninitialized warning when compiling with address santizer
-rw-r--r-- | build_settings.cmake | 5 |
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. |