From c6ed640daa8da40b9223d3401211d3223515cb92 Mon Sep 17 00:00:00 2001 From: Lukas Senionis Date: Sun, 4 Aug 2024 05:11:38 +0300 Subject: [PATCH] build(linux): disable GCC 12 Wrestrict warning (#2925) --- cmake/compile_definitions/common.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/compile_definitions/common.cmake b/cmake/compile_definitions/common.cmake index f4a91a78..a2260595 100644 --- a/cmake/compile_definitions/common.cmake +++ b/cmake/compile_definitions/common.cmake @@ -6,12 +6,19 @@ list(APPEND SUNSHINE_COMPILE_OPTIONS -Wall -Wno-sign-compare) # Werror - treat warnings as errors # Wno-maybe-uninitialized/Wno-uninitialized - disable warnings for maybe uninitialized variables # Wno-sign-compare - disable warnings for signed/unsigned comparisons +# Wno-restrict - disable warnings for memory overlap if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # GCC specific compile options # GCC 12 and higher will complain about maybe-uninitialized if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12) list(APPEND SUNSHINE_COMPILE_OPTIONS -Wno-maybe-uninitialized) + + # Disable the bogus warning that may prevent compilation (only for GCC 12). + # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105651. + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13) + list(APPEND SUNSHINE_COMPILE_OPTIONS -Wno-restrict) + endif() endif() elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # Clang specific compile options