-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
The current main
branch fails to build if the -Wc++11-narrowing
option is used:
internal/pycore_stackref.h:649:39: error: non-constant-expression cannot be narrowed from type 'intptr_t' (aka 'long') to 'uintptr_t' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]
649 | *out = (_PyStackRef){ .bits = (intptr_t)op | Py_TAG_DEFERRED };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The fix is to change the cast to uintptr_t
which matches the type of .bits
.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error