CMakeLists: Warn when casting away cv-qualifiers from pointers

Warns whenever this type of casting isn't done via const_cast.
This commit is contained in:
Lioncash 2016-08-22 17:21:00 -04:00 committed by MerryMage
parent 47f285249b
commit 0ebad78432

View file

@ -20,8 +20,16 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules)
if (MSVC) if (MSVC)
add_compile_options(/W3 /MP /Zi /Zo /EHsc /WX) add_compile_options(/W3 /MP /Zi /Zo /EHsc /WX)
else() else()
add_compile_options(-Wall -Werror -Wextra -pedantic -pedantic-errors -Wfatal-errors add_compile_options(-Wall
-Wno-unused-parameter -Wno-missing-braces) -Werror
-Wextra
-Wcast-qual
-pedantic
-pedantic-errors
-Wfatal-errors
-Wno-unused-parameter
-Wno-missing-braces)
if (ARCHITECTURE_x86_64) if (ARCHITECTURE_x86_64)
add_compile_options(-msse4.1) add_compile_options(-msse4.1)
endif() endif()