From 46aa9d75fa9b633124025e5b85c37e25fe039d62 Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Sun, 12 Jul 2015 12:32:33 -0500 Subject: [PATCH] -Wconversion * https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html * http://programmers.stackexchange.com/questions/122608/clang-warning-flags-for-objective-c-development/124574#124574 In clang: `-Wconversion` implies `-Wshorten-64-to-32` --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c5c75d2..cbaff68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,10 +97,10 @@ endif( MSVC ) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # using regular Clang or AppleClang - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wshorten-64-to-32") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wconversion -Wshadow") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # using GCC - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -pedantic") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wconversion -Wshadow -Wextra -Wsign-conversion -pedantic") endif() IF(JSONCPP_WITH_WARNING_AS_ERROR)