From 0ebad78432b8e63887847ddc9cdc98d3c8449057 Mon Sep 17 00:00:00 2001 From: Lioncash <mathew1800@gmail.com> Date: Mon, 22 Aug 2016 17:21:00 -0400 Subject: [PATCH] CMakeLists: Warn when casting away cv-qualifiers from pointers Warns whenever this type of casting isn't done via const_cast. --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 30123a0c..11026ffe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,8 +20,16 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) if (MSVC) add_compile_options(/W3 /MP /Zi /Zo /EHsc /WX) else() - add_compile_options(-Wall -Werror -Wextra -pedantic -pedantic-errors -Wfatal-errors - -Wno-unused-parameter -Wno-missing-braces) + add_compile_options(-Wall + -Werror + -Wextra + -Wcast-qual + -pedantic + -pedantic-errors + -Wfatal-errors + -Wno-unused-parameter + -Wno-missing-braces) + if (ARCHITECTURE_x86_64) add_compile_options(-msse4.1) endif()