#195 added PyObject_GenericHash, but did not define it static inline. So if more than one compilation unit uses the header, the gcc 14 linker sees more than one definition for the function and complains.
diff --git a/pythoncapi_compat.h b/pythoncapi_compat.h index e307119..c6fe172 100644 --- a/pythoncapi_compat.h +++ b/pythoncapi_compat.h @@ -1236,7 +1236,7 @@ static inline Py_hash_t Py_HashPointer(const void *ptr) #if PY_VERSION_HEX < _Py_PACK_VERSION(3, 13) || defined(Py_LIMITED_API) -Py_hash_t +static inline Py_hash_t PyObject_GenericHash(PyObject *obj) { return Py_HashPointer(obj);
Oops, thanks, I applied your patch: #205.
It's not the first time that I make this mistake (forget static inline), so I wrote #206 test to detect it in the CI.
Thanks for the quick fix
Ok, with commit b8fe76f, the CI should catch such mistake if it occurs again.
use earlier pythoncapi-compat, HEAD has python/pythoncapi-compat#204
Activity
vstinner commented on Oct 16, 2026
Oops, thanks, I applied your patch: #205.
It's not the first time that I make this mistake (forget static inline), so I wrote #206 test to detect it in the CI.
mattip commented on Oct 16, 2026
Thanks for the quick fix
vstinner commented on Oct 16, 2026
Ok, with commit b8fe76f, the CI should catch such mistake if it occurs again.
use earlier pythoncapi-compat, HEAD has python/pythoncapi-compat#204