[U-Boot] warnings from gcc-4.4 build
    Kumar Gala 
    galak at kernel.crashing.org
       
    Mon Jul  6 17:10:20 CEST 2009
    
    
  
On Jul 4, 2009, at 6:33 PM, Wolfgang Denk wrote:
> Dear Kumar Gala,
>
> In message  
> <9B5E5AE1-2907-49C2-870F-2D7B2F2DE598 at kernel.crashing.org> you wrote:
>> When building the MPC8572DS_config w/gcc-4.4 I get:
>>
>> sys_eeprom.c: In function ‘do_mac’:
>> sys_eeprom.c:323: warning: dereferencing type-punned pointer will  >
>> break strict-aliasing rules
> ...
>> Should would be turning on -fno-strict-aliasing.  The linux kernel  
>> has  >
>> been doing this for some time.
>
> Should we not rather fix the code that causes these warnings? Usually
> the required changes are just minimal (which does not mean that it is
> a trivial task).
For some cases its trivial, for others I'm not sure if its worth it  
(like ahci.c):
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 ?
For dlmalloc I think we might want to look at updating to a newer  
version of the code.
- k
    
    
More information about the U-Boot
mailing list