Iain Buclaw <ibuc...@gdcproject.org> writes: > Currently, GCC is converting the expression to a signed integer > instead of an unsigned one. Does a test for the testsuite need to be > written for this?
The C standard makes this implementation-defined, and GCC defines it like this (*Note (gcc) Arrays and pointers implementation::): A cast from pointer to integer discards most-significant bits if the pointer representation is larger than the integer type, sign-extends(1) if the pointer representation is smaller than the integer type, otherwise the bits are unchanged. ---------- Footnotes ---------- (1) Future versions of GCC may zero-extend, or use a target-defined `ptr_extend' pattern. Do not rely on sign extension. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."