mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +03:00
Treat "not all control paths return a value" warning as an error
This commit is contained in:
parent
4a4a552a05
commit
02ce50ace2
1 changed files with 10 additions and 1 deletions
|
@ -16,8 +16,17 @@ set(CMAKE_DEBUG_POSTFIX "-dbg")
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
# Treat no return type as error
|
||||||
|
add_compile_options(/we4715)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
add_compile_options(-Wno-comment)
|
add_compile_options(-Wno-comment)
|
||||||
|
# Treat no return type as error
|
||||||
|
add_compile_options(-Werror=return-type)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
# Ignore warnings for code like 'assert("Assert string")'
|
# Ignore warnings for code like 'assert("Assert string")'
|
||||||
add_compile_options(-Wno-pointer-bool-conversion)
|
add_compile_options(-Wno-pointer-bool-conversion)
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue