Fix false positive gcc warning on legitimate use of `strndup`.
@@ -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)
