Skip to content

gh-131296: Fix clang-cl warning on Windows in posixmodule.c #133142

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Wulian233
Copy link
Contributor

@Wulian233 Wulian233 commented Apr 29, 2025

Only 1 warning in posixmodule.c

..\Modules\posixmodule.c(4193,17): warning : result of comparison of constant 4611686018427387903 with expression of ty
pe 'DWORD' (aka 'unsigned long') is always true [-Wtautological-constant-out-of-range-compare] 

Please add skip news label :)

Copy link

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

looks good. do we also need to update relevant test for this change?

@Wulian233
Copy link
Contributor Author

Generally not. We only fix some compilation warnings and did not make obviously change. can refer to #131296

@@ -4189,7 +4189,7 @@ posix_getcwd(int use_bytes)
/* If the buffer is large enough, len does not include the
terminating \0. If the buffer is too small, len includes
the space needed for the terminator. */
if (len >= Py_ARRAY_LENGTH(wbuf)) {
if ((size_t)len >= Py_ARRAY_LENGTH(wbuf)) {
Copy link
Member

Choose a reason for hiding this comment

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

This does not fix the warning, because it happens in the next line

if (len <= PY_SSIZE_T_MAX / sizeof(wchar_t))

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

Successfully merging this pull request may close these issues.

4 participants