[coreboot] [RFC] Error out on implicit declarations

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Mon Dec 22 17:21:16 CET 2008


On 22.12.2008 17:14, Myles Watson wrote:
>   
>> -----Original Message-----
>> From: Carl-Daniel Hailfinger [mailto:c-d.hailfinger.devel.2006 at gmx.net]
>> Sent: Monday, December 22, 2008 6:48 AM
>> To: Myles Watson
>> Cc: Marc Jones; Coreboot; jordan at cosmicpenguin.net
>> Subject: Re: [coreboot] [RFC] Error out on implicit declarations
>>
>> On 18.12.2008 19:33, Myles Watson wrote:
>>     
>>> On Thu, Dec 18, 2008 at 11:08 AM, Marc Jones <marcj303 at gmail.com> wrote:
>>>
>>>       
>>>> On Thu, Dec 18, 2008 at 10:22 AM, Myles Watson <mylesgw at gmail.com>
>>>>         
>> wrote:
>>     
>>>>> On Thu, Dec 18, 2008 at 7:52 AM, Jordan Crouse
>>>>>           
>> <jordan at cosmicpenguin.net
>>     
>>>>> wrote:
>>>>>
>>>>>           
>>>>>> Myles Watson wrote:
>>>>>>
>>>>>>             
>>>>>>> On Thu, Dec 18, 2008 at 3:18 AM, Carl-Daniel Hailfinger <
>>>>>>> c-d.hailfinger.devel.2006 at gmx.net> wrote:
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>>>> Bao, Zheng found a bug which killed SATA booting on my board.
>>>>>>>>
>>>>>>>> This happened because we do not error out on implicit function
>>>>>>>> declarations. The linker has no way of checking whether the
>>>>>>>>                 
>> implicitly
>>     
>>>>>>>> assumed function signature is identical to the real signature, so
>>>>>>>> mismatches can occur and these mismatches are practically
>>>>>>>>                 
>> impossible
>>     
>>>>>>>> to debug because the code looks completely correct.
>>>>>>>>
>>>>>>>> Adding -Werror-implicit-function-declaration to our CFLAGS would
>>>>>>>>                 
>> solve
>>     
>>>>>>>> this problem nicely, but a lot of files in the tree need to be
>>>>>>>>                 
>> fixed.
>>     
>>>>>>>>                 
>>>>>>> I think this is a great idea.  Isn't the correct order to fix all
>>>>>>>               
>> the
>>     
>>>>>>> warnings, then make it an error?
>>>>>>>
>>>>>>>               
>>>>>> Yeah - the unfortunate thing about changes like this is that you end
>>>>>>             
>> up
>>     
>>>>>> being responsible for fixing the errors.. :)
>>>>>>
>>>>>>             
>>>>>> Carl-Daniel - if you post a list of offending files, we'll all help
>>>>>> clear them up.  Dumping the log through grep "implicit
>>>>>> declaration of function" should suffice.
>>>>>>
>>>>>>             
>>> I'm attaching a patch which I thought was trivial, but breaks things all
>>> over the place.  I'm not sure how this will need to be done.  It looks
>>>       
>> like
>>     
>>> a problem with romcc vs. CAR.
>>>
>>>       
>> Try this patch. It passes abuild.
>>
>> Regards,
>> Carl-Daniel
>>
>> Fix implicit declarations of pci_read_config8 and pci_write_config8 in
>> the following files:
>> src/mainboard/intel/jarrell/reset.c
>> src/mainboard/supermicro/x6dai_g/reset.c
>> src/mainboard/supermicro/x6dhe_g2/reset.c
>> src/mainboard/supermicro/x6dhe_g/reset.c
>> src/mainboard/supermicro/x6dhr_ig2/reset.c
>> src/mainboard/supermicro/x6dhr_ig/reset.c
>>
>> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
>>     
> Acked-by: Myles Watson <mylesgw at gmail.com>
>   

Thanks, r3832.

Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/





More information about the coreboot mailing list