在现有项目中启用PREfast静态分析检查会产生以下许多实例:
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\WindowsNumerics.inl(2375) : warning C6101: Returning uninitialized memory ‘*scale’. A successful path through the function does not set the named Out parameter. Annotate this function with Success(return) if returning FALSE indicates failure.: Lines: 2375, 2379, 2381, 2383, 2375这可能是通过包含以下任何一个头来触发的:
#include <winrt/Windows.Storage.FileProperties.h>
#include <winrt/Windows.Media.Capture.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Data.Json.h>但是,到目前为止,我看到的所有实例对WindowsNumerics.inl来说似乎都是常见的。
这使我们无法在winrt项目上启用PREfast,而无需在代码中添加特定的抑制作为解决方案。我们应该期望winrt头通过这些检查吗?这会在将来的发行版中得到解决吗?
发布于 2021-12-29 21:39:23
这似乎是倒置和分解函数上缺少的头部注释的一种情况。
这个bug仍然存在于最新的公共Windows (22000)中。
我将看看是否能够找到所有者为将来的Windows版本提交一个bug。
您还没有提到您使用的是哪个工具集,但是您应该看看/external开关。
https://stackoverflow.com/questions/70500526
复制相似问题