From 555331f6e7774fd5bbf7403c3b7d23ee03b7bb24 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Thu, 14 Nov 2024 07:00:30 +0000 Subject: [PATCH] Disable Clang warning -Wexit-time-destructors. This warns on `static const std::map<...>`. re2c is single-threaded, so there's no risk of race conditions when one thread is terminating and the other one tries to access the object. --- cmake/Re2cCompilerFlags.cmake | 2 ++ configure.ac | 1 + 2 files changed, 3 insertions(+) diff --git a/cmake/Re2cCompilerFlags.cmake b/cmake/Re2cCompilerFlags.cmake index ea14af068..88dd345ab 100644 --- a/cmake/Re2cCompilerFlags.cmake +++ b/cmake/Re2cCompilerFlags.cmake @@ -53,6 +53,8 @@ if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # re2c uses C++11, not C++98 "-Wno-c++98-compat" "-Wno-c++98-compat-pedantic" + # re2c is single-threaded => no danger of race conditions + "-Wno-exit-time-destructors" ) try_cxxflag("-fdiagnostics-color=always") diff --git a/configure.ac b/configure.ac index 2e3ce53a1..bb81bda93 100644 --- a/configure.ac +++ b/configure.ac @@ -188,6 +188,7 @@ TRY_CXXFLAG([-Weverything], m4_join([ ], [-Wno-c++98-compat-pedantic], [-Wno-unsafe-pointer-arithmetic], [-Wno-unsafe-buffer-usage], + [-Wno-exit-time-destructors], dnl re2c is single-threaded => no danger of race conditions [-Wno-switch-enum]))