Is it possible to detect an integer overflow with the Python ctypes module?
The docs suggest that none of the primitives support overflow checking, but I'd like to write my own so I can use native c types for my CPU emulator.
Is it possible to detect an integer overflow with the Python ctypes module?
The docs suggest that none of the primitives support overflow checking, but I'd like to write my own so I can use native c types for my CPU emulator.
ctypes isn’t for doing operations on integers, it’s for calling functions in shareable libraries. Any relevant integer arithmetic would still have to be done in Python.
Unless the sharable library is itself providing integer-arithmetic functions, in which case it would have to do the overflow detection.
c_* types to generally do overflow checking on parameter conversion?