Fixed warning "maybe uninitialized" (issue #909)

This commit is contained in:
Benoit Blanchon
2019-02-28 12:20:46 +01:00
parent f483b06735
commit 5c297ba4a2
3 changed files with 9 additions and 0 deletions

View File

@@ -46,6 +46,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6)
add_compile_options(-Wnoexcept)
endif()
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.7 AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
# avoid false positive with GCC 4.7
add_compile_options(-Wno-maybe-uninitialized)
endif()
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")