[coreboot] [Patch] remove some warnings

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Thu Mar 18 01:17:17 CET 2010


Hi Segher,

you're probably able to solve this one easily.

On 18.03.2010 00:45, Myles Watson wrote:
>>> -extern unsigned char AmlCode[];
>>> +extern void* AmlCode;
>>>
>>>
>>>  So AmlCode is used as a void * pointing to the address 0x54445344
>>>
>>> which is definitely not what you want...
>>>
>>>       
>> You're right.  And that's definitely not what I expected to happen.  It
>> seems like there ought to be a correct way to do this.  I'll keep looking.
>>
>> What is it, you want to do?
>>
>>     
> Get rid of the type punned warning that gcc gives for that code where
> AmlCode gets cast to acpi_header_t.
>   

Could __attribute__((may_alias)) help?

Then again, a Google search turns up a few miscompiles with that
attribute, so another option may be to run memcpy(AmlCode,AmlCode, ...).

Regards,
Carl-Daniel

-- 
"I do consider assignment statements and pointer variables to be among
computer science's most valuable treasures."
-- Donald E. Knuth





More information about the coreboot mailing list