Repository navigation
Fix remaining strict compiler warnings - #1641
Open
Daniel Jump (DanielJump) wants to merge 3 commits into
Open
Daniel Jump (DanielJump) wants to merge 3 commits into
Daniel Jump (DanielJump) wants to merge 3 commits into
Conversation
Use safe ABI casts, explicit enum and Boolean handling, correct aggregate initialization, effective PCH ordering, and remove or annotate unused test helpers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8b45cfea-cc0f-4a1f-8b2a-86c89d063c6c Hostname: DanJump0
Preserve constness through abi_cast and remove it only from the final ABI pointer, avoiding redundant implementation and base-class casts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8b45cfea-cc0f-4a1f-8b2a-86c89d063c6c Hostname: DanJump0
Interpret the encoded high bit through intptr_t and test for a negative value instead of rebuilding and masking a pointer-sized flag. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8b45cfea-cc0f-4a1f-8b2a-86c89d063c6c Hostname: DanJump0
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Core ABI casts and tagged weak references affect object identity and lifetime across architectures, but x64 Debug validation and ARM64 build-only CI leave cross-target runtime behavior unverified, warranting human review.
No open issues 🎉
What changed in this PR
This PR addresses remaining strict-compiler warnings in the C++/WinRT generator, runtime headers, and tests. It prepares the codebase for stricter CI enforcement in #1640 without introducing warning-policy changes.
Changes:
- Use the existing ABI cast helper and preserve constness until the final pointer conversion.
- Make enum cases, Boolean conversions, and weak-reference flag detection explicit.
- Clean up unused test helpers, aggregate initialization, and precompiled-header include order.
| File | Description |
|---|---|
test/test/return_params_abi.cpp |
Remove an unused helper and its warning suppression. |
test/test/GetMany.cpp |
Add explicit nested braces to array initialization. |
test/test_component/Class.cpp |
Replace unused-function suppression with [[maybe_unused]]. |
test/old_tests/UnitTests/Parameters.cpp |
Make array aggregate initialization explicit. |
test/old_tests/UnitTests/Main.cpp |
Include the precompiled header first. |
strings/base_reference_produce.h |
Use abi_cast for the ABI pointer conversion. |
strings/base_implements.h |
Preserve cast constness and simplify weak-reference flag detection. |
strings/base_fast_forward.h |
Explicitly convert the comparison result to Boolean. |
cppwinrt/type_writers.h |
Explicitly enumerate unsupported constant types. |
cppwinrt/code_writers.h |
Explicitly enumerate categories using default output binding. |
cppwinrt/cmd_reader.h |
Explicitly convert option counts to Boolean. |
Review effort: Max
Ryan Shepherd (DefaultRyan)
approved these changes
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
/Wall /WXbuild on the local integration branch