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

2016-09-20 Thread Kyle Altendorf
Kyle Altendorf added the comment: A little macro funny business gets a function the ability to know if the type passed to its wrapping macro is signed or not. http://ideone.com/NZYs7u // http://stackoverflow.com/questions/7469915 #define IS_UNSIGNED(v) (v >= 0 && ~v >= 0) #define F(v) f

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

2016-09-20 Thread Kyle Altendorf
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. -IInclude -I./Include -I"/epc/t/262/misc-build-arm-fsl-l