[U-Boot] warnings from gcc-4.4 build
Wolfgang Denk
wd at denx.de
Sat Jul 11 01:05:28 CEST 2009
Dear Scott Wood,
In message <20090706175233.GA5964 at b07421-ec1.am.freescale.net> you wrote:
> On Mon, Jul 06, 2009 at 10:10:20AM -0500, Kumar Gala wrote:
> > static int ata_scsiop_read_capacity10(ccb *pccb)
> > {
> > u8 buf[8];
> >
> > memset(buf, 0, 8);
> >
> > *(u32 *) buf = le32_to_cpu(ataid[pccb->target]->lba_capacity);
> >
> > buf[6] = 512 >> 8;
> > buf[7] = 512 & 0xff;
> >
> > memcpy(pccb->pdata, buf, 8);
> >
> > return 0;
> > }
> >
> > how do we fix this (the *u32 *)buf ... line is the one causing
> > warnings ?
>
> Use a union.
Or simply a temporary variable to perform the conversion in two
separate steps.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
'What shall we do?' said Twoflower. 'Panic?' said Rincewind hope-
fully. He always held that panic was the best means of survival; back
in the olden days, his theory went, people faced with hungry sabre-
toothed tigers could be divided very simply in those who panicked and
those who stood there saying 'What a magnificent brute!' or 'Here,
pussy.' - Terry Pratchett, _The Light Fantastic_
More information about the U-Boot
mailing list