In order to pass /analyze to the build, the CI passed -DCMAKE_CXX_FLAGS=/analyze:autolog-. However, at
, we set
CMAKE_CXX_FLAGS to
"". This overrides the setting from the command line.
Thus, we aren't ever actually using /analyze. In fact, if we change the CMakeLists.txt to pass /analyze, we get warnings:
PS C:\..\nimazzuc\projects\stl> cmake --build out/test-analyze
[0/1] Re-running CMake...
-- Boost.Math: standalone mode ON
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/nimazzuc/projects/stl/out/test-analyze
[9/984] Building CXX object stl\CMakeFiles\msvcp_objects.dir\src\StlLCMapStringA.cpp.obj
FAILED: stl/CMakeFiles/msvcp_objects.dir/src/StlLCMapStringA.cpp.obj
C:\PROGRA~1\MICROS~1\2022\Preview\VC\Tools\MSVC\1433~1.315\bin\HOSTAR~1\ARM64\cl.exe /nologo /TP -DCRTDLL2 -DNTDDI_VERSION=NTDDI_WIN10_CO -DSTRICT -DWIN32_LEAN_AND_MEAN -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -D_ARM64_ -D_CRTBLD -D_CRT_DECLARE_NONSTDC_NAMES=1 -D_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS -D_DLL -D_HAS_OLD_IOSTREAMS_MEMBERS=1 -D_STL_CONCRT_SUPPORT -D_STL_WIN32_WINNT=0x0A00 -D_VCRT_ALLOW_INTERNALS -D_VCRT_WIN32_WINNT=0x0A00 -D_WIN32_WINNT=0x0A00 -I"C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.33.31517\crt\src\vcruntime" -IC:\Users\nimazzuc\projects\stl\stl\inc /WX /Gy /diagnostics:caret /W4 /w14265 /w15038 /fastfail /guard:cf /Z7 /Zp8 /std:c++latest /permissive- /Zc:threadSafeInit- /Zl /analyze:autolog- /O2 /Os /GL /EHsc /showIncludes /Fostl\CMakeFiles\msvcp_objects.dir\src\StlLCMapStringA.cpp.obj /Fdstl\CMakeFiles\msvcp_objects.dir\ /FS -c C:\Users\nimazzuc\projects\stl\stl\src\StlLCMapStringA.cpp
C:\Users\nimazzuc\projects\stl\stl\src\StlLCMapStringA.cpp(121,1): error C2220: the following warning is treated as an error
}
^
c:\program files (x86)\windows kits\10\include\10.0.22000.0\um\winnls.h(3087) : warning C6553: The annotation for function 'LCMapStringEx' on _Param_(9) does not apply to a value type.
[11/984] Building CXX object stl\CMakeFiles\msvcp_objects.dir\src\StlLCMapStringW.cpp.obj
FAILED: stl/CMakeFiles/msvcp_objects.dir/src/StlLCMapStringW.cpp.obj
C:\PROGRA~1\MICROS~1\2022\Preview\VC\Tools\MSVC\1433~1.315\bin\HOSTAR~1\ARM64\cl.exe /nologo /TP -DCRTDLL2 -DNTDDI_VERSION=NTDDI_WIN10_CO -DSTRICT -DWIN32_LEAN_AND_MEAN -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -D_ARM64_ -D_CRTBLD -D_CRT_DECLARE_NONSTDC_NAMES=1 -D_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS -D_DLL -D_HAS_OLD_IOSTREAMS_MEMBERS=1 -D_STL_CONCRT_SUPPORT -D_STL_WIN32_WINNT=0x0A00 -D_VCRT_ALLOW_INTERNALS -D_VCRT_WIN32_WINNT=0x0A00 -D_WIN32_WINNT=0x0A00 -I"C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.33.31517\crt\src\vcruntime" -IC:\Users\nimazzuc\projects\stl\stl\inc /WX /Gy /diagnostics:caret /W4 /w14265 /w15038 /fastfail /guard:cf /Z7 /Zp8 /std:c++latest /permissive- /Zc:threadSafeInit- /Zl /analyze:autolog- /O2 /Os /GL /EHsc /showIncludes /Fostl\CMakeFiles\msvcp_objects.dir\src\StlLCMapStringW.cpp.obj /Fdstl\CMakeFiles\msvcp_objects.dir\ /FS -c C:\Users\nimazzuc\projects\stl\stl\src\StlLCMapStringW.cpp
C:\Users\nimazzuc\projects\stl\stl\src\StlLCMapStringW.cpp(51,1): error C2220: the following warning is treated as an error
}
^
c:\program files (x86)\windows kits\10\include\10.0.22000.0\um\winnls.h(3087) : warning C6553: The annotation for function 'LCMapStringEx' on _Param_(9) does not apply to a value type.
[14/984] Building CXX object stl\CMakeFiles\msvcp_objects.dir\src\instances.cpp.obj
ninja: build stopped: subcommand failed.
PS C:\..\nimazzuc\projects\stl>
Note that this is a bug in the Windows SDK - it applies _In_opt_ to an LPARAM (i.e., an intptr_t)
In order to pass
/analyzeto the build, the CI passed-DCMAKE_CXX_FLAGS=/analyze:autolog-. However, atSTL/CMakeLists.txt
Line 43 in 7f04137
CMAKE_CXX_FLAGSto"". This overrides the setting from the command line.Thus, we aren't ever actually using
/analyze. In fact, if we change the CMakeLists.txt to pass/analyze, we get warnings:Note that this is a bug in the Windows SDK - it applies
_In_opt_to anLPARAM(i.e., anintptr_t)