-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add /sdl compiler flag for SDL compliance #121510
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
Conversation
…Compression.Native Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
Removed individual SDL linker switches from CMakeLists.txt files and instead added the /sdl compiler flag globally in eng/native/configurecompiler.cmake. This approach is cleaner and applies the SDL checks to all MSVC builds from a central location. Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
The /sdl flag is a superset of /GS, so the explicit /GS flag is redundant and can be removed. Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
|
@copilot Delete |
The /sdl flag automatically enables SDL-required warnings as errors (C4055, C4146, C4242, C4244, C4267, C4302, C4308, C4509, C4510, C4532, C4533, C4610, C4611, C4700, C4701, C4703, C4789, C4995, C4996), so these explicit /we options are no longer needed. Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
There was a problem hiding this 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 adds the /sdl compiler flag to enable comprehensive Security Development Lifecycle (SDL) checks for all MSVC builds. The /sdl flag provides a superset of security features that includes buffer security checks (/GS), making the explicit /GS flag redundant.
- Added
/sdlflag globally ineng/native/configurecompiler.cmakefor all MSVC C/CXX compilations - Removed the now-redundant
/GSflag since/sdlalready includes buffer security checks
|
/ba-g android timeouts |
Add /sdl compiler flag for SDL compliance
This PR adds the
/sdlcompiler flag to enable SDL (Security Development Lifecycle) checks for all MSVC builds and removes redundant flags that are now subsumed by/sdl.Summary
/sdlflag to central MSVC configuration in eng/native/configurecompiler.cmake/GSflag (subsumed by/sdl)/wewarning options (subsumed by/sdl)Changes
Added the
/sdlcompiler flag globally ineng/native/configurecompiler.cmakefor all MSVC C/CXX compilations, and removed redundant flags:/GSflag (buffer security checks) - included in/sdl/wewarning options (SDL-required warnings as errors) - included in/sdlImplementation
The
/sdlflag:/GS(buffer security checks) functionalityNet Changes
/sdlflag)/GSflag + 19/weoptions + 3 comment lines + 1 empty line)This simplifies the configuration while maintaining full SDL compliance through the comprehensive
/sdlflag.Why
/sdlinstead of individual switches?Individual switches like
/DYNAMICBASE,/NXCOMPAT, and/HIGHENTROPYVAare already enabled by default in modern MSVC toolchains. The/sdlcompiler flag provides comprehensive SDL compliance by enabling additional compile-time checks and warnings, eliminating the need for explicit/GSand numerous/weoptions.Note:
/GUARD:CF(Control Flow Guard) is already applied globally viaconfigurecompiler.cmake.Fixes #121509
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.