From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2 V2] USB: Fix complaints about strict aliasing in OHCI-HCD
Date: Sat, 20 Aug 2011 15:41:36 -0400 [thread overview]
Message-ID: <201108201541.37522.vapier@gentoo.org> (raw)
In-Reply-To: <201108202132.56067.marek.vasut@gmail.com>
On Saturday, August 20, 2011 15:32:55 Marek Vasut wrote:
> On Saturday, August 20, 2011 09:29:06 PM Mike Frysinger wrote:
> > 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.
>
> And endianity comes into play here too ... that's where my brain started
> chugging a bit too. That's why I'd like to see other's opinion on this.
endianness isn't an issue between the union-of-pointers and union-of-storage.
in both cases, you start at the same base address.
-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/d2975c7b/attachment.pgp
next prev parent reply other threads:[~2011-08-20 19:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-20 19:15 [U-Boot] [PATCH 1/2 V2] USB: Fix complaints about strict aliasing in OHCI-HCD Marek Vasut
2011-08-20 19:15 ` [U-Boot] [PATCH 2/2 V2] IDE: Fix complaints about strict aliasing in cmd_ide.c Marek Vasut
2011-08-20 19:29 ` Mike Frysinger
2011-10-01 19:53 ` Wolfgang Denk
2011-08-20 19:29 ` [U-Boot] [PATCH 1/2 V2] USB: Fix complaints about strict aliasing in OHCI-HCD Mike Frysinger
2011-08-20 19:32 ` Marek Vasut
2011-08-20 19:41 ` Mike Frysinger [this message]
2011-10-06 21:49 ` Wolfgang Denk
2011-10-07 0:00 ` [U-Boot] [PATCH 1/2 V3] " Marek Vasut
2011-10-08 17:47 ` Remy Bohmer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201108201541.37522.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox