From cb4b09e58caa6e0a99df16d8f4d25f375f0f3d83 Mon Sep 17 00:00:00 2001 From: Ash Vardanian <1983160+ashvardanian@users.noreply.github.com> Date: Mon, 9 Dec 2024 08:37:45 +0000 Subject: [PATCH] Avoid `-Wstringop-overflow` in GCC 14 --- cmake/compilers/GNU.cmake | 4 ++-- src/tbb/concurrent_monitor.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/compilers/GNU.cmake b/cmake/compilers/GNU.cmake index cdef6596b6..da6b408af3 100644 --- a/cmake/compilers/GNU.cmake +++ b/cmake/compilers/GNU.cmake @@ -83,8 +83,8 @@ if (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL Intel) set(TBB_DSE_FLAG $<$>:-flifetime-dse=1>) set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$>:-fstack-clash-protection>) - # Suppress GCC 12.x-13.x warning here that to_wait_node(n)->my_is_in_list might have size 0 - set(TBB_COMMON_LINK_FLAGS ${TBB_COMMON_LINK_FLAGS} $<$>,$>:-Wno-stringop-overflow>) + # Suppress GCC 12.x-14.x warning here that to_wait_node(n)->my_is_in_list might have size 0 + set(TBB_COMMON_LINK_FLAGS ${TBB_COMMON_LINK_FLAGS} $<$>,$>:-Wno-stringop-overflow>) endif() # Workaround for heavy tests and too many symbols in debug (rellocation truncated to fit: R_MIPS_CALL16) diff --git a/src/tbb/concurrent_monitor.h b/src/tbb/concurrent_monitor.h index 3e5c4bebe8..cacfb145a8 100644 --- a/src/tbb/concurrent_monitor.h +++ b/src/tbb/concurrent_monitor.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2005-2023 Intel Corporation + Copyright (c) 2005-2024 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -291,14 +291,14 @@ class concurrent_monitor_base { if (n != end) { my_waitset.remove(*n); -// GCC 12.x-13.x issues a warning here that to_wait_node(n)->my_is_in_list might have size 0, since n is +// GCC 12.x-14.x issues a warning here that to_wait_node(n)->my_is_in_list might have size 0, since n is // a base_node pointer. (This cannot happen, because only wait_node pointers are added to my_waitset.) -#if (__TBB_GCC_VERSION >= 120100 && __TBB_GCC_VERSION < 140000 ) && !__clang__ && !__INTEL_COMPILER +#if (__TBB_GCC_VERSION >= 120100 && __TBB_GCC_VERSION < 150000 ) && !__clang__ && !__INTEL_COMPILER #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstringop-overflow" #endif to_wait_node(n)->my_is_in_list.store(false, std::memory_order_relaxed); -#if (__TBB_GCC_VERSION >= 120100 && __TBB_GCC_VERSION < 140000 ) && !__clang__ && !__INTEL_COMPILER +#if (__TBB_GCC_VERSION >= 120100 && __TBB_GCC_VERSION < 150000 ) && !__clang__ && !__INTEL_COMPILER #pragma GCC diagnostic pop #endif }