Skip to content

Avoid C4319 warnings from UNW_ALIGN#931

Merged
bregma merged 1 commit intolibunwind:masterfrom
MihaZupan:C4319
Jan 8, 2026
Merged

Avoid C4319 warnings from UNW_ALIGN#931
bregma merged 1 commit intolibunwind:masterfrom
MihaZupan:C4319

Conversation

@MihaZupan
Copy link
Contributor

MSVC 19.44.35221.0 now warns on some uses, the added casts avoid it.

src\mi\mempool.c(96): warning C4319: '~': zero extending 'unsigned long' to 'size_t' of greater size
src\mi\mempool.c(127): warning C4319: '~': zero extending 'unsigned long' to 'size_t' of greater size

cc: @am11

@am11
Copy link
Contributor

am11 commented Dec 3, 2025

Thanks, LGTM!

cc @bregma

steveisok pushed a commit to dotnet/runtime that referenced this pull request Dec 9, 2025
Include libunwind/libunwind#931 in the build of
the libunwind dependency.

Fixes runtime build errors on `1es-windows-2022-open` that are blocking
HTTP & SSL stress runs.

## Customer Impact

- [x] Found internally

Our internal HTTP and SSL stress tests are failing to build on the 8.0
branch.
An update of MSVC in the `1es-windows-2022-open` image brought updated
analyzer rules that now fail the build of dotnet/runtime on Windows.
```
mempool.c(96): warning C4319: '~': zero extending 'unsigned long' to 'size_t' of greater size
```

This change adds `(size_t)` casts in the libunwind dependency, which
resolves the new errors.

## Regression

- [X] Yes

Infra update.

## Testing

Regular CI is still passing + CI stress runs for HTTP and SSL now build
and work again.

## Risk

Low.
This is a one-line targeted fix that only adds casts.
@bregma
Copy link
Member

bregma commented Jan 8, 2026

Looking at places where this macro is used with types other than size_t it seems that that usage is incorrect and they should also be using size_t. So this change should never hurt anything.

@bregma bregma merged commit a0b61b3 into libunwind:master Jan 8, 2026
ViktorHofer pushed a commit to dotnet/runtime that referenced this pull request Jan 23, 2026
Include libunwind/libunwind#931 in the build of
the libunwind dependency.

Fixes runtime build errors on `1es-windows-2022-open` that are blocking
HTTP & SSL stress runs.

- [x] Found internally

Our internal HTTP and SSL stress tests are failing to build on the 8.0
branch.
An update of MSVC in the `1es-windows-2022-open` image brought updated
analyzer rules that now fail the build of dotnet/runtime on Windows.
```
mempool.c(96): warning C4319: '~': zero extending 'unsigned long' to 'size_t' of greater size
```

This change adds `(size_t)` casts in the libunwind dependency, which
resolves the new errors.

- [X] Yes

Infra update.

Regular CI is still passing + CI stress runs for HTTP and SSL now build
and work again.

Low.
This is a one-line targeted fix that only adds casts.
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