Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve C4267 warnings in win32/ioutil for x64 #17674

Merged
merged 1 commit into from
Feb 2, 2025

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Feb 2, 2025

C4267[1] are about conversion from size_t to a "smaller" type, causing potential loss of data (aka. truncation).

In this case we can solve that cleanly (i.e. without casting and further checks) by changing the affected variables to be of type DWORD.

[1] https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4267


Considering the full list of C4267 this is just a drop in the bucket, but as they are saying, constant dripping wears the stone. :)

C4267[1] are about conversion from `size_t` to a "smaller" type,
causing potential loss of data (aka. truncation).

In this case we can solve that cleanly (i.e. without casting and
further checks) by changing the affected variables to be of type
`DWORD`.

[1] <https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4267>
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSTM

@cmb69 cmb69 removed the ABI break label Feb 2, 2025
@cmb69
Copy link
Member Author

cmb69 commented Feb 2, 2025

To clarify the PR/commit title: there is/was nothing to fix for x86, since both DWORD as size_t are uint32_t for that platform.

@cmb69 cmb69 merged commit caf5e8a into php:master Feb 2, 2025
9 checks passed
@cmb69 cmb69 deleted the cmb/c4267-ioutil branch February 2, 2025 23:15
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