Skip to content

Enable all warnings for cppwinrt CI - #1640

Open
Daniel Jump (DanielJump) wants to merge 4 commits into
microsoft:masterfrom
DanielJump:warnings-enforce-ci
Open

Daniel Jump (DanielJump) wants to merge 4 commits into
microsoft:masterfrom
DanielJump:warnings-enforce-ci

Conversation

@DanielJump

@DanielJump Daniel Jump (DanielJump) commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Why

Issue #1620 identified warning regressions that normal Level4 builds do not catch. This pull request first enables the stricter warning surface across the validation projects so the complete inventory can be assessed before warnings-as-errors is restored.

What

  • Set the cppwinrt compiler project to EnableAllWarnings for Debug and Release on x86, x64, and ARM64.
  • Add a CI-only late MSBuild override that applies EnableAllWarnings after project-local settings.
  • Enable that override for compiler, test, natvis, and NuGet validation builds.
  • Temporarily set TreatWarningAsError to false in the CI override so the full warning inventory is visible instead of stopping at the first diagnostic.

Normal local test builds retain their current warning level unless CppWinRTEnableAllWarnings=true is explicitly supplied.

Current assessment

A local MSVC x64 Debug solution build with /Wall and /WX- produced 237,297 warning emissions, deduplicated to 41,980 file/line/code/message diagnostics. Most are repeated warnings from generated headers, the Windows SDK, Catch, and known /Wall noise. The build also encountered two unrelated build errors after producing the inventory.

Warnings-as-errors will be restored after the warning set is classified into cppwinrt defects, external diagnostics, and intentional suppressions.

Build the cppwinrt compiler with all warnings enabled while retaining the existing warnings-as-errors policy across every configuration.

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

Copilot-Session: 8b45cfea-cc0f-4a1f-8b2a-86c89d063c6c
Hostname: DanJump0
@DefaultRyan

Copy link
Copy Markdown
Member

Thanks for starting this. The compiler project doesn't actually consume the generated headers, though. We should enable the stricter, build-breaking options on the test projects as well to verify that we don't regress and re-introduce new warnings.

Apply all-warnings and warnings-as-errors after project-local settings, and enable the override throughout the Windows CI matrix so generated headers are compiled under the stricter policy.

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

Copilot-Session: 8b45cfea-cc0f-4a1f-8b2a-86c89d063c6c
Hostname: DanJump0
@DanielJump

Copy link
Copy Markdown
Member Author

AI-generated

Updated in 687be84. The strict warning policy is now applied after project-local settings through a CI opt-in in Directory.Build.targets, and the opt-in is passed to compiler, test, natvis, and NuGet validation builds. This means the generated headers are compiled under EnableAllWarnings plus TreatWarningAsError, rather than only compiling cppwinrt.exe with those settings.

Keep all warnings enabled across validation projects but temporarily disable warnings-as-errors so the complete warning inventory can be assessed before deciding which diagnostics to fix or suppress.

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

Copilot-Session: 8b45cfea-cc0f-4a1f-8b2a-86c89d063c6c
Hostname: DanJump0
@DanielJump

Copy link
Copy Markdown
Member Author

AI-generated

I ran a local MSVC x64 Debug solution build with /Wall and /WX- before making warning fixes. It produced 237,297 warning emissions, deduplicated to 41,980 file/line/code/message diagnostics. Most are repeated generated-header, Windows SDK, Catch, and standard /Wall warnings.

Commit 548a327 keeps the strict warning level across compiler, test, natvis, and NuGet validation projects but temporarily disables warnings-as-errors, so CI can produce a complete cross-configuration inventory. I will classify that output before restoring the build-breaking setting or changing source.

@sylveon

Copy link
Copy Markdown
Contributor

Why not use /W:external to check non-cppwinrt headers with /W4 instead of /Wall

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants