add: visual studio Compiler warning (order of attribute init in c++ constructors)
authorGaia Clary <gaia.clary@machinimatrix.org>
Thu, 29 Nov 2018 15:56:33 +0000 (16:56 +0100)
committerGaia Clary <gaia.clary@machinimatrix.org>
Thu, 29 Nov 2018 16:04:12 +0000 (17:04 +0100)
CMakeLists.txt

index dfeb1d6..83177de 100644 (file)
@@ -1526,6 +1526,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}")