Skip to content

Fix PREfast Warning C26495, and excluded the generated file path for prefast task #5556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

qiutongMS
Copy link
Contributor

@qiutongMS qiutongMS commented Jun 25, 2025

1.Some of the warnings need initialize variables in this repo.
2.Warnings under "Generated Files/winrt" folder or under STL headers folder, prefast tasks don't need to scan them. 

A microsoft employee must use /azp run to validate using the pipelines below.

WARNING:
Comments made by azure-pipelines bot maybe inaccurate.
Please see pipeline link to verify that the build is being ran.

For status checks on the main branch, please use TransportPackage-Foundation-PR
(https://microsoft.visualstudio.com/ProjectReunion/_build?definitionId=81063&_a=summary)
and run the build against your PR branch with the default parameters.

@qiutongMS
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

m_nSegmentOverride = 0;
m_lScratchExtra = 0;
m_pbScratchTarget = nullptr;
memset(m_rbScratchDst, 0, sizeof(m_rbScratchDst));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nonblocking nit: it is unclear why introducing the use of memset() here. This file already uses ZeroMemory(), does it make sense to keep using ZeroMemory()?

@@ -84,7 +84,7 @@ steps:
msBuildCommandline: 'msbuild.exe /restore /nologo /nr:false /p:configuration=Release /p:platform=x64 $(Build.SourcesDirectory)\WindowsAppRuntime.sln'
# Generally speaking, we leave it to the external repos to scan the bits in their packages.
excludedPaths: |
$(Build.SourcesDirectory)\packages
C:\__t\uCRT\#$(Build.SourcesDirectory)\obj\$(buildConfiguration)\$(buildPlatform)#$(Build.SourcesDirectory)\packages
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please try replacing "__t" with "$(Agent.ToolsDirectory)" to see if it still works?
We generally prefer using more readable/meaningful variable names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants