Skip to content

Commit

Permalink
Avoid -Wstringop-overflow in GCC 14
Browse files Browse the repository at this point in the history
  • Loading branch information
ashvardanian committed Dec 9, 2024
1 parent bd689b5 commit 3ec6882
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cmake/compilers/GNU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ if (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL Intel)
set(TBB_DSE_FLAG $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},6.0>>:-flifetime-dse=1>)
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},8.0>>:-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} $<$<AND:$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},12.0>>,$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},14.0>>:-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} $<$<AND:$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},12.0>>,$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},15.0>>:-Wno-stringop-overflow>)
endif()

# Workaround for heavy tests and too many symbols in debug (rellocation truncated to fit: R_MIPS_CALL16)
Expand Down
6 changes: 3 additions & 3 deletions src/tbb/concurrent_monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 3ec6882

Please sign in to comment.