Alignment issue on x86_64?

Rémi Cardona remi@gentoo.org
Mon Jun 23 16:17:00 GMT 2008


Andrew Haley a écrit :
> Are you using optimization?

No, I'm building with those CFLAGS : -g -ggdb -Wall -save-temps 
-fno-strict-aliasing

>  I think can see at least one bug in this function.
> 
>       ((CARD32 *)data)[i] = ((long *)retval)[i];

You're absolutely right, CARD32 is defined as an "unsigned long" on x86 
but as an "unsigned int" on x86_64. Changing this does not however 
change anything in how the Xlib call done just before behaves.

> Try compiling with -fno-strict-aliasing.

Doesn't change anything. No additional warnings nor any change in behavior.

-- 
Rémi Cardona
LRI, INRIA
remi.cardona@lri.fr
remi@gentoo.org



More information about the Gcc-help mailing list