Skip to content

[release/10.0] Avoid C4319 build warnings in libunwind#125465

Open
steveisok wants to merge 1 commit intodotnet:release/10.0from
steveisok:steveisok/backport-libunwind-c4319-10.0
Open

[release/10.0] Avoid C4319 build warnings in libunwind#125465
steveisok wants to merge 1 commit intodotnet:release/10.0from
steveisok:steveisok/backport-libunwind-c4319-10.0

Conversation

@steveisok
Copy link
Member

Backport of #123535 (main) / #122179 (release/9.0) to release/10.0.

Include libunwind/libunwind#931 in the build of the libunwind dependency. Adds (size_t) casts to the UNW_ALIGN macro to avoid C4319 warnings that are treated as errors with newer MSVC toolsets.

Context

An MSVC toolset update (19.44.3522019.44.35221) introduced stricter C4319 analysis. Combined with /WX (warnings as errors), this breaks the cross-OS DAC build of libunwind on Windows:

mempool.c(96): error C2220: the following warning is treated as an error
mempool.c(96): warning C4319: '~': zero extending 'unsigned long' to 'size_t' of greater size

This is causing Windows_x86_BuildPass2 failures in the VMR dotnet-unified-build pipeline on release/10.0.1xx (e.g., internal build 2924142).

Fix

Same one-line fix as #122179 / #123535: cast operands to size_t in the UNW_ALIGN macro.

Risk

Low — targeted cast-only change, already validated on 9.0 and main.

Backport of dotnet#123535 (main) / dotnet#122179 (release/9.0) to release/10.0.

Include libunwind/libunwind#931 in the build
of the libunwind dependency. Adds (size_t) casts to the UNW_ALIGN
macro to avoid C4319 warnings that are treated as errors with newer
MSVC toolsets.

This fixes Windows_x86_BuildPass2 failures in the VMR
dotnet-unified-build pipeline on release/10.0.1xx.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet-policy-service
Copy link
Contributor

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

@steveisok steveisok requested a review from a team March 11, 2026 23:13
Copy link
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

Backports the libunwind fix to avoid MSVC C4319 warnings (treated as errors with /WX) by updating the UNW_ALIGN macro to use size_t casts, and records inclusion of upstream libunwind PR #931 in the dependency patch list.

Changes:

  • Update UNW_ALIGN macro to cast operands to size_t to avoid MSVC C4319 warning.
  • Record application of libunwind upstream PR #931 in the libunwind version tracking file.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/native/external/libunwind/include/libunwind_i.h Uses size_t casts in UNW_ALIGN to prevent MSVC C4319 warnings under /WX.
src/native/external/libunwind-version.txt Documents that libunwind PR #931 is applied in the vendored dependency.

You can also share your feedback on Copilot code review. Take the survey.

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

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants