Skip to content

Commit b6c2ef0

Browse 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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/posixmodule.c

Lines 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)