From efae6428130c4295db2a8ef483cef1a55a120b10 Mon Sep 17 00:00:00 2001 From: Davis King Date: Sat, 5 Aug 2023 12:24:42 -0400 Subject: [PATCH] Work around bug in gcc 11.4.0 causing spurious compile error --- dlib/test/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlib/test/CMakeLists.txt b/dlib/test/CMakeLists.txt index 0a17c8247..9fadd237b 100644 --- a/dlib/test/CMakeLists.txt +++ b/dlib/test/CMakeLists.txt @@ -177,8 +177,8 @@ if (CMAKE_COMPILER_IS_GNUCXX) add_compile_options(-Wno-strict-overflow) add_compile_options(-Wno-maybe-uninitialized) - if (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 11.3.0) - # GCC 11.3 wrongly yields this warning: + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.3.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 11.4.0) + # These versions of gcc wrongly yield this warning: # dlib::row_major_layout::layout >::data’ with nonzero offset 8 [-Werror=free-nonheap-object] # 61 | delete [] item; # Which by inspection of the dlib::row_major_layout::layout class you can see is clearly incorrect, as `data` is most