Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b6c2ef0

Browse filesBrowse files
authored
gh-131296: Avoid posixmodule.c warning (GH-133142)
Clang-cl detects that on 32-bit builds the variable is always smaller than the value. But since the same code is used for other architectures, we can't just _fix_ it. This cast avoids the tautological-constant-out-of-range-compare warning.
1 parent 0c5151b commit b6c2ef0
Copy full SHA for b6c2ef0

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎Modules/posixmodule.c

Copy file name to clipboardExpand all lines: Modules/posixmodule.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4207,7 +4207,7 @@ posix_getcwd(int use_bytes)
42074207
terminating \0. If the buffer is too small, len includes
42084208
the space needed for the terminator. */
42094209
if (len >= Py_ARRAY_LENGTH(wbuf)) {
4210-
if (len <= PY_SSIZE_T_MAX / sizeof(wchar_t)) {
4210+
if ((Py_ssize_t)len <= PY_SSIZE_T_MAX / sizeof(wchar_t)) {
42114211
wbuf2 = PyMem_RawMalloc(len * sizeof(wchar_t));
42124212
}
42134213
else {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.