Skip to content

Remove C4995 suppression - #11807

Open
mmitche wants to merge 2 commits into
dotnet:mainfrom
mmitche:fix-c4995-suppression
Open

Remove C4995 suppression#11807
mmitche wants to merge 2 commits into
dotnet:mainfrom
mmitche:fix-c4995-suppression

Conversation

@mmitche

@mmitche mmitche commented Jul 30, 2026

Copy link
Copy Markdown
Member

Description

Remove the global managed C++ suppression for warning C4995. This prevents /wd4995 from being applied to DirectWriteForwarder and resolves the BinSkim BA2007 result tracked by dotnet/dotnet#8042.

Validation

Built DirectWriteForwarder in Release for x86, x64, and arm64 with zero warnings and zero errors in the dotnet/dotnet VMR.

Microsoft Reviewers: Open in CodeFlow

Remove the global managed C++ warning suppression so BinSkim no longer reports BA2007 for DirectWriteForwarder.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7718d31d-6d80-41f3-a6d5-b441d4616058
@mmitche
mmitche requested review from a team and Copilot July 30, 2026 16:06
@mmitche
mmitche requested a review from a team as a code owner July 30, 2026 16:06
@dotnet-policy-service dotnet-policy-service Bot added the PR metadata: Label to tag PRs, to facilitate with triage label Jul 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes the global managed C++ suppression for compiler warning C4995 so that /wd4995 is no longer applied broadly (notably to DirectWriteForwarder), aligning with the BinSkim BA2007 mitigation goal referenced in dotnet/dotnet#8042.

Changes:

  • Removed C4995 from the ManagedCxxSuppressions list used to populate common managed C++ warning disables.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@akoeplinger

akoeplinger commented Aug 18, 2026

Copy link
Copy Markdown
Member

can probably also remove now that it's no longer /clr:pure and I think /clr:netcore isn't actually deprecated

# This repo uses C++/CLI /clr:pure (or /clr:netcore) switches during compilation, which are
# deprecated. Ensure that this warning is always suppressed during build.
if (($properties -eq $null) -or (-not ($properties -icontains '/nowarn:D9035'))) {
$properties = @('/nowarn:D9035') + $properties
}

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: dc79d0ce-c030-4966-8296-34932c6b46ed
@mmitche

mmitche commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

@dipeshmsft Can you take a look?

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

Labels

PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants