[U-Boot] [PATCH 1/2 V2] USB: Fix complaints about strict aliasing in OHCI-HCD

Mike Frysinger vapier at gentoo.org
Sat Aug 20 21:29:06 CEST 2011


On Saturday, August 20, 2011 15:15:12 Marek Vasut wrote:
>  	__u32 datab[4];
> -	__u8 *data_buf = (__u8 *)datab;
> +	union {
> +		void *ptr;
> +		__u8 *u8;
> +		__u16 *u16;
> +		__u32 *u32;
> +	} databuf;
> 
> +	databuf.u32 = (__u32 *)datab;

i'm not sure this is correct, but i'm not really an expert on aliasing 
behavior.  i think the union should sit on top of the storage, and not hide 
the pointer casts.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110820/3b1cc807/attachment.pgp 


More information about the U-Boot mailing list