[XEN PATCH v4 1/9] automation/eclair: fix deviation of MISRA C Rule 16.3

Federico Serafini posted 9 patches 2 months ago
There is a newer version of this series
[XEN PATCH v4 1/9] automation/eclair: fix deviation of MISRA C Rule 16.3
Posted by Federico Serafini 2 months ago
Escape the final dot of the comment and extend the search of a
fallthrough comment up to 2 lines after the last statement.

Fixes: Fixes: a128d8da91 ("automation/eclair: add deviations for MISRA C:2012 Rule 16.3")
Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 0d94635275..e95554acae 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -499,7 +499,7 @@ safe."
 -doc_end
 
 -doc_begin="Switch clauses ending with an explicit comment indicating the fallthrough intention are safe."
--config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\* [fF]all ?through.? \\*/.*$,0..1))))"}
+-config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\* [fF]all ?through\\.? \\*/.*$,0..2))))"}
 -doc_end
 
 -doc_begin="Switch statements having a controlling expression of enum type deliberately do not have a default case: gcc -Wall enables -Wswitch which warns (and breaks the build as we use -Werror) if one of the enum labels is missing from the switch."
-- 
2.34.1
Re: [XEN PATCH v4 1/9] automation/eclair: fix deviation of MISRA C Rule 16.3
Posted by Jan Beulich 1 month, 3 weeks ago
On 15.07.2024 18:48, Federico Serafini wrote:
> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
> @@ -499,7 +499,7 @@ safe."
>  -doc_end
>  
>  -doc_begin="Switch clauses ending with an explicit comment indicating the fallthrough intention are safe."
> --config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\* [fF]all ?through.? \\*/.*$,0..1))))"}
> +-config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\* [fF]all ?through\\.? \\*/.*$,0..2))))"}
>  -doc_end
>  
>  -doc_begin="Switch statements having a controlling expression of enum type deliberately do not have a default case: gcc -Wall enables -Wswitch which warns (and breaks the build as we use -Werror) if one of the enum labels is missing from the switch."

This patch doesn't apply. There's a somewhat similar entry, but its doc_begin
line is sufficiently different. I have no idea what's going on here; there's
no dependency stated anywhere.

Jan
Re: [XEN PATCH v4 1/9] automation/eclair: fix deviation of MISRA C Rule 16.3
Posted by Federico Serafini 1 month, 3 weeks ago
On 24/07/24 11:45, Jan Beulich wrote:
> On 15.07.2024 18:48, Federico Serafini wrote:
>> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
>> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
>> @@ -499,7 +499,7 @@ safe."
>>   -doc_end
>>   
>>   -doc_begin="Switch clauses ending with an explicit comment indicating the fallthrough intention are safe."
>> --config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\* [fF]all ?through.? \\*/.*$,0..1))))"}
>> +-config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\* [fF]all ?through\\.? \\*/.*$,0..2))))"}
>>   -doc_end
>>   
>>   -doc_begin="Switch statements having a controlling expression of enum type deliberately do not have a default case: gcc -Wall enables -Wswitch which warns (and breaks the build as we use -Werror) if one of the enum labels is missing from the switch."
> 
> This patch doesn't apply. There's a somewhat similar entry, but its doc_begin
> line is sufficiently different. I have no idea what's going on here; there's
> no dependency stated anywhere.

Right, this patch depends on [1] which has not been committed yet.

[1]
https://lists.xenproject.org/archives/html/xen-devel/2024-06/msg01347.html

-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)
Re: [XEN PATCH v4 1/9] automation/eclair: fix deviation of MISRA C Rule 16.3
Posted by Jan Beulich 1 month, 3 weeks ago
On 24.07.2024 13:32, Federico Serafini wrote:
> On 24/07/24 11:45, Jan Beulich wrote:
>> On 15.07.2024 18:48, Federico Serafini wrote:
>>> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
>>> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
>>> @@ -499,7 +499,7 @@ safe."
>>>   -doc_end
>>>   
>>>   -doc_begin="Switch clauses ending with an explicit comment indicating the fallthrough intention are safe."
>>> --config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\* [fF]all ?through.? \\*/.*$,0..1))))"}
>>> +-config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\* [fF]all ?through\\.? \\*/.*$,0..2))))"}
>>>   -doc_end
>>>   
>>>   -doc_begin="Switch statements having a controlling expression of enum type deliberately do not have a default case: gcc -Wall enables -Wswitch which warns (and breaks the build as we use -Werror) if one of the enum labels is missing from the switch."
>>
>> This patch doesn't apply. There's a somewhat similar entry, but its doc_begin
>> line is sufficiently different. I have no idea what's going on here; there's
>> no dependency stated anywhere.
> 
> Right, this patch depends on [1] which has not been committed yet.
> 
> [1]
> https://lists.xenproject.org/archives/html/xen-devel/2024-06/msg01347.html

Which in turn isn't ready to be committed yet afaict, due to a pending
question regarding ASSERT_UNREACHABLE().

In any event - please make sure you prominently state dependencies on
uncommitted patches (outside of the same series of course).

Jan