]> xenbits.xensource.com Git - xen.git/commitdiff
automation/eclair: fix deviation of MISRA C Rule 16.3
authorFederico Serafini <federico.serafini@bugseng.com>
Tue, 30 Jul 2024 09:52:31 +0000 (11:52 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 30 Jul 2024 09:52:31 +0000 (11:52 +0200)
Add missing escape for the final dot of the fallthrough comment,
extend the search of a fallthrough comment up to 2 lines after the last
statement and improve the text of the justification.

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

index 0af1cb93d1e01ac95cdae5fc2de1cb269d3eae74..603480161e67131363cfbfdfbf2172de1602ebf4 100644 (file)
@@ -482,9 +482,8 @@ safe."
 -config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(/BUG\\(\\);/))))"}
 -doc_end
 
--doc_begin="Switch clauses not ending with the break statement are safe if an
-explicit comment indicating the fallthrough intention is present."
--config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\* [fF]all ?through.? \\*/.*$,0..1))))"}
+-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..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."