On 27.06.2022 09:54, xenia wrote:
> On 6/27/22 10:11, Jan Beulich wrote:
>> On 26.06.2022 23:11, Xenia Ragiadakou wrote:
>>> The function vm_event_wake() is referenced only in vm_event.c.
>>> Change the linkage of the function from external to internal by adding
>>> the storage-class specifier static to the function definition.
>>>
>>> This patch aims to resolve indirectly a MISRA C 2012 Rule 8.4 violation 
>>> warning.
>> Actually also for patch 1 - this is slightly confusing, as the title
>> talks about 8.7. At first I suspected a typo. May I suggest to add
>> "also" (which I think could be easily done while committing)?
> 
> 
> This is actually a violation of MISRA C 2012 Rule 8.7 (Advisory), which 
> states that functions referenced in only one translation unit should not 
> be defined with external linkage.
> This violation triggers a MISRA C 2012 Rule 8.4 violation warning, 
> because the function is defined with external linkage without a visible 
> declaration at the point of definition.
> I thought that this does not make it a violation of MISRA C 2012 Rule 8.4.

I think this is a violation of both rules. It would be a violation of
only 8.7 if the function had a declaration, but still wasn't used
outside its defining CU.

Jan

Reply via email to