Kyle Altendorf added the comment:
I do not seem to be getting a compiler warning.
arm-fsl-linux-gnueabi-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv
-O3 -Wall -Wstrict-prototypes -Werror=declaration-after-statement -I.
-DPy_BUILD_CORE -c ./Modules/socketmodule.c -o Modules/socketmodule.o
To really encompass all cases I think you are correct that both a signed and an
unsigned handler are needed. Though, I have an idea for something nifty, I'll
share if it works.
Regardless, shouldn't they use `intmax_t` and `uintmax_t` from stdtypes.h to
make sure they handle anything that could be defined in the referenced C code?
In my case simply switching from `long` to `intmax_t` would be sufficient.
Note that I am not worried about getting this fixed for my one case. My
workaround is fine for my application.
I also will hopefully be correcting the subject to >=2**31 if this change does
what I think. Good ol' off-by-one.
title: PyModule_AddIntConstant() wraps >=2^32 values when long is 4 bytes ->
PyModule_AddIntConstant() wraps >=2^31 values when long is 4 bytes
Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list