From a66d381be93f0a324156b464d22d6576726edb96 Mon Sep 17 00:00:00 2001 From: Alexander Babikov Date: Thu, 7 Apr 2022 05:23:23 +0500 Subject: [PATCH] Convert a false positive warning suppression in the Voodoo dynarec code into a pragma --- src/include/86box/vid_voodoo_codegen_x86-64.h | 5 +++++ src/include/86box/vid_voodoo_codegen_x86.h | 5 +++++ src/video/CMakeLists.txt | 6 ------ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/include/86box/vid_voodoo_codegen_x86-64.h b/src/include/86box/vid_voodoo_codegen_x86-64.h index fa973c5ff..632eacfb4 100644 --- a/src/include/86box/vid_voodoo_codegen_x86-64.h +++ b/src/include/86box/vid_voodoo_codegen_x86-64.h @@ -20,6 +20,11 @@ #define LOD_MASK (LOD_TMIRROR_S | LOD_TMIRROR_T) +/* Suppress a false positive warning on gcc that causes excessive build log spam */ +#if __GNUC__ >= 10 +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif + typedef struct voodoo_x86_data_t { uint8_t code_block[BLOCK_SIZE]; diff --git a/src/include/86box/vid_voodoo_codegen_x86.h b/src/include/86box/vid_voodoo_codegen_x86.h index e1afdd163..6bde2c0c6 100644 --- a/src/include/86box/vid_voodoo_codegen_x86.h +++ b/src/include/86box/vid_voodoo_codegen_x86.h @@ -20,6 +20,11 @@ #define LOD_MASK (LOD_TMIRROR_S | LOD_TMIRROR_T) +/* Suppress a false positive warning on gcc that causes excessive build log spam */ +#if __GNUC__ >= 10 +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif + typedef struct voodoo_x86_data_t { uint8_t code_block[BLOCK_SIZE]; diff --git a/src/video/CMakeLists.txt b/src/video/CMakeLists.txt index b3182afe8..3e1ffcc71 100644 --- a/src/video/CMakeLists.txt +++ b/src/video/CMakeLists.txt @@ -47,9 +47,3 @@ add_library(voodoo OBJECT vid_voodoo.c vid_voodoo_banshee.c if(NOT MSVC AND (ARCH STREQUAL "i386" OR ARCH STREQUAL "x86_64")) target_compile_options(voodoo PRIVATE "-msse2") endif() - -# Suppress GCC false positive warnings in vid_voodoo_codegen_x86[-64].h -# that cause ~3000 lines to be output into the logs each time -if(CMAKE_C_COMPILER_ID STREQUAL "GNU") - target_compile_options(voodoo PRIVATE "-Wstringop-overflow=0") -endif()