[issue28215] PyModule_AddIntConstant() wraps >=2^32 values when long is 4 bytes

Christian Heimes report at bugs.python.org
Tue Sep 20 13:00:35 EDT 2016


Christian Heimes added the comment:

The constant is an unsigned long but PyModule_AddIntConstant() takes a signed long. You have to write your own function that uses PyLong_FromUnsignedLong() and PyModule_AddObject().

Do you get a compiler warning because 0x80000000U is larger than (1<<31)-1?

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28215>
_______________________________________


More information about the Python-bugs-list mailing list