From 23284e4dde5e759d082e82d6cb666cb10f43e716 Mon Sep 17 00:00:00 2001 From: Gaia Clary Date: Thu, 29 Nov 2018 16:56:33 +0100 Subject: [PATCH] add: visual studio Compiler warning (order of attribute init in c++ constructors) --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ccc6d54c9a4..5741588b6af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1458,6 +1458,11 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC") "/we4431" # missing type specifier - int assumed ) + if(MSVC_VERSION GREATER_EQUAL 1911) + # see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=vs-2017 + set(_WARNINGS "${_WARNINGS} /w35038") #order of initialisation in c++ constructors + endif() + string(REPLACE ";" " " _WARNINGS "${_WARNINGS}") set(C_WARNINGS "${_WARNINGS}") set(CXX_WARNINGS "${_WARNINGS}")