[Info-vax] problem with 64-bit pointers in C
ergamenes at gmail.com
ergamenes at gmail.com
Wed Jan 31 04:50:12 EST 2018
On Wednesday, 31 January 2018 08:36:25 UTC, Joukj wrote:
> Looks like the artthmatic - (and + ) on pointers is not resulting in the
> expected 64-bit pointer as it should.
I can see two problems: one is that subtracting arbitrary pointers is UB, so anything can happen.
The other thing is that when it is valid, it gives a result that is of type ptrdiff_t, which here is defined to be an int. That does mean that there is a restriction that you can't have arrays of more than 2^31 elements.
More information about the Info-vax
mailing list