mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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.
This commit is contained in:
parent
0c5151bc81
commit
b6c2ef0c7a
1 changed files with 1 additions and 1 deletions
|
@ -4207,7 +4207,7 @@ posix_getcwd(int use_bytes)
|
|||
terminating \0. If the buffer is too small, len includes
|
||||
the space needed for the terminator. */
|
||||
if (len >= Py_ARRAY_LENGTH(wbuf)) {
|
||||
if (len <= PY_SSIZE_T_MAX / sizeof(wchar_t)) {
|
||||
if ((Py_ssize_t)len <= PY_SSIZE_T_MAX / sizeof(wchar_t)) {
|
||||
wbuf2 = PyMem_RawMalloc(len * sizeof(wchar_t));
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue