On Fri, Sep 11, 2009 at 11:18:19AM +0200, Wolfgang Denk wrote: > Fix warning: flash.c:531: warning: dereferencing type-punned pointer > will break strict-aliasing rules > > Signed-off-by: Wolfgang Denk <w...@denx.de> > Cc: K?ri Dav??sson <k...@flaga.is> > --- > board/flagadm/flash.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/board/flagadm/flash.c b/board/flagadm/flash.c > index bbefbac..ff37d9e 100644 > --- a/board/flagadm/flash.c > +++ b/board/flagadm/flash.c > @@ -528,7 +528,8 @@ int write_word (flash_info_t *info, ulong dest, ulong da) > ulong start; > char csr; > int flag; > - ushort * d = (ushort*)&da; > + ulong *dla = &da; > + ushort *d = (ushort*)dla;
I don't see how this is any more legal under strict aliasing rules -- you just made it a little more complicated and fooled the compiler into not warning. -Scott _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot