summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorJieqiang Wang <jieqiang.wang@arm.com>2023-07-24 15:42:22 +0800
committerDamjan Marion <dmarion@0xa5.net>2023-11-07 10:58:50 +0000
commit92ab407a5960d2e269b39826cac05f8133cb277b (patch)
tree5aa845e9dbe7b652a316b6aa1c98a32416e9575b /src/CMakeLists.txt
parent76d14b797c05aa5e7ac9aa9ee99e6b03ee0837db (diff)
build: disable bogus warnings for GCC 12
The array bounds and string overread check on GCC 12 report a dozen of false positives that result in VPP build failures on ubuntu 22.04. Work around this build issue by unconditionally disabling these two warnings if C compiler is GCC 12 or newer version. Type: fix Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com> Change-Id: I999e847bb625ebdf3ef5f11b11598c553f306670
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b6d48f5b5ea..4ef4259d8f6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -59,6 +59,14 @@ elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL GCC_STRING_OVERFLOW_WARNING_DISABLE_VERSION)
add_compile_options(-Wno-stringop-overflow)
endif()
+ set(GCC_STRING_OVERREAD_WARNING_DISABLE_VERSION 12.0.0)
+ if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL GCC_STRING_OVERREAD_WARNING_DISABLE_VERSION)
+ add_compile_options(-Wno-stringop-overread)
+ endif()
+ set(GCC_ARRAY_BOUNDS_WARNING_DISABLE_VERSION 12.0.0)
+ if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL GCC_ARRAY_BOUNDS_WARNING_DISABLE_VERSION)
+ add_compile_options(-Wno-array-bounds)
+ endif()
else()
message(WARNING "WARNING: Unsupported C compiler `${CMAKE_C_COMPILER_ID}` is used")
set (PRINT_MIN_C_COMPILER_VER TRUE)