Skip to content

Update MSVC build flags to meet SDL requirements#121823

Merged
jkotas merged 1 commit intomainfrom
levib/cpp_sdl_checks
Nov 20, 2025
Merged

Update MSVC build flags to meet SDL requirements#121823
jkotas merged 1 commit intomainfrom
levib/cpp_sdl_checks

Conversation

@GrabYourPitchforks
Copy link
Copy Markdown
Member

Re-enables specific MSVC compiler warnings as error so that we continue to meet SDL requirements. Addresses regression introduced by #121510.

Copilot AI review requested due to automatic review settings November 19, 2025 22:51
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR re-enables specific MSVC compiler warnings as errors to meet Microsoft's Security Development Lifecycle (SDL) requirements, addressing a regression introduced by PR #121510.

Key Changes

  • Enhanced documentation for the /sdl compiler flag to clarify its security features
  • Added 11 SDL-required compiler warnings as errors (4018, 4055, 4242, 4244, 4267, 4302, 4509, 4510, 4611, 4701, 4510, 4610)
  • Included comprehensive documentation explaining which warnings are covered by /sdl and which need explicit configuration

Comment thread eng/native/configurecompiler.cmake
Copy link
Copy Markdown
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks

@jkotas jkotas merged commit b3d1db9 into main Nov 20, 2025
156 of 158 checks passed
@akoeplinger akoeplinger deleted the levib/cpp_sdl_checks branch November 21, 2025 12:07
@agocke
Copy link
Copy Markdown
Member

agocke commented Dec 1, 2025

/backport to release/10.0

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 1, 2025

Started backporting to release/10.0 (link to workflow run)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 1, 2025

@agocke backporting to release/10.0 failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Update MSVC flags to meet SDL requirements
Using index info to reconstruct a base tree...
M	eng/native/configurecompiler.cmake
Falling back to patching base and 3-way merge...
Auto-merging eng/native/configurecompiler.cmake
CONFLICT (content): Merge conflict in eng/native/configurecompiler.cmake
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Update MSVC flags to meet SDL requirements
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

@github-actions github-actions Bot locked and limited conversation to collaborators Jan 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants