This is an automated email from the ASF dual-hosted git repository.

pengzheng pushed a commit to branch feature/civetweb_integration
in repository https://gitbox.apache.org/repos/asf/celix.git

commit f3315369faee0196b1ec5c2ded518d872b013063
Author: PengZheng <[email protected]>
AuthorDate: Thu Feb 2 16:01:05 2023 +0800

    Fix false positive gcc warning on legitimate use of `strndup`.
---
 CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 321d1470..51af284f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -124,6 +124,10 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
         set(CMAKE_C_FLAGS "-Wno-stringop-truncation ${CMAKE_C_FLAGS}")
         set(CMAKE_CXX_FLAGS "-Wno-stringop-truncation ${CMAKE_CXX_FLAGS}")
     endif()
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0)
+        set(CMAKE_C_FLAGS "-Wno-error=stringop-overread ${CMAKE_C_FLAGS}")
+        set(CMAKE_CXX_FLAGS "-Wno-error=stringop-overread ${CMAKE_CXX_FLAGS}")
+    endif()
 endif()
 
 option(ENABLE_MORE_WARNINGS "whether to enable more compiler warnings." OFF)

Reply via email to