On 2/12/10, Richard Guenther <richard.guent...@gmail.com> wrote: > On Fri, Feb 12, 2010 at 10:41 AM, Jakub Jelinek <ja...@redhat.com> wrote: > > It seems pointers are sign extended to wider integers, is that intentional?
> Your program prints zero-extends for ICC. > > Probably the behavior is undefined and we get a warning anyway: All C requires is that casting a opinter to an integer and back again should be a no-op, so either behaviour should work, although there's a more detailed explanation here with references to the language standards: http://gcc.gnu.org/onlinedocs/gcc/Arrays-and-pointers-implementation.html To address your specific point, it says: "extends according to the signedness of the integer type if the pointer representation is larger than the integer type" M