would using casts fix the problem?
Posted Apr 16, 2008 21:29 UTC (Wed) by MathFox
In reply to: would using casts fix the problem?
Parent article: GCC and pointer overflows
I guess that you missed the point completely. aend-a (no casts needed) should give 10 on any platform. The bit pattern in a pointer is implementation defined and that particular platform had (64-bits IIRC) word-based addresses in a 48 bit address space. The low 48 bits of a character pointer were the address of the word containing the character; the high bits addressed the byte in the word.
Standard conforming programs don't rely on pointer layout.
to post comments)