From: Konstantinos Margaritis Date: Fri, 16 Sep 2022 11:04:59 +0000 (+0300) Subject: clang 13+ gives wrong -Wunused-but-set-variable error on nfa/mcclellancompile.cpp... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=257cf1e31143df149eddd434c00eca6e9d8d5e25;p=thirdparty%2Fvectorscan.git clang 13+ gives wrong -Wunused-but-set-variable error on nfa/mcclellancompile.cpp about total_daddy variable, disabling --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 57e986c9..5076f0a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,5 @@ -cmake_minimum_required (VERSION 2.8.11) +cmake_minimum_required (VERSION 2.8.12) + project (vectorscan C CXX) set (HS_MAJOR_VERSION 5) @@ -296,6 +297,12 @@ if (NOT RELEASE_BUILD) # release builds set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Werror") set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Werror") + if (CMAKE_COMPILER_IS_CLANG) + if (CMAKE_C_COMPILER_VERSION VERSION_GREATER "13.0") + set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Wno-unused-but-set-variable") + set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wno-unused-but-set-variable") + endif() + endif() endif() if (DISABLE_ASSERTS)