Skip to content

Fix -Wsign-compare warning when reading hpage_pmd_size - #1447

Merged
Daan (daanx) merged 1 commit into
microsoft:dev3from
DinoV:cpython-thp-size-sign-compare
Oct 23, 2026
Merged

Daan (daanx) merged 1 commit into
microsoft:dev3from
DinoV:cpython-thp-size-sign-compare

Conversation

@DinoV

Copy link
Copy Markdown
Contributor

unix_detect_large_page_size compares the parsed 'long size' against SIZE_MAX, which is unsigned, so builds with -Wsign-compare (or -Wextra) warn about comparing integers of different signedness. size is known to be positive at that point, so cast it to unsigned long for the comparison.

unix_detect_large_page_size compares the parsed 'long size' against
SIZE_MAX, which is unsigned, so builds with -Wsign-compare (or -Wextra)
warn about comparing integers of different signedness. size is known
to be positive at that point, so cast it to unsigned long for the
comparison.
@daanx
Daan (daanx) merged commit 9403a32 into microsoft:dev3 Oct 23, 2026
1 check passed
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.

2 participants