[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] automation/eclair_analysis: amend configuration for some MISRA rules



commit f4cd14e502bafe773d8c808010c53e99c750290f
Author:     Alessandro Zucchelli <alessandro.zucchelli@xxxxxxxxxxx>
AuthorDate: Thu May 9 18:02:17 2024 -0700
Commit:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
CommitDate: Thu May 9 18:02:17 2024 -0700

    automation/eclair_analysis: amend configuration for some MISRA rules
    
    Adjust ECLAIR configuration for rules: R21.14, R21.15, R21.16 by taking
    into account mem* macros defined in the Xen sources as if they were
    equivalent to the ones in Standard Library.
    
    Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@xxxxxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 automation/eclair_analysis/ECLAIR/analysis.ecl | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl 
b/automation/eclair_analysis/ECLAIR/analysis.ecl
index 66ed7f952c..d4628d582c 100644
--- a/automation/eclair_analysis/ECLAIR/analysis.ecl
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -19,6 +19,23 @@ map_strings("scheduled-analysis",analysis_kind)
 
 -enable=B.EXPLAIN
 
+-doc_begin="These configurations serve the purpose of recognizing the 'mem*' 
macros as
+their Standard Library equivalents."
+
+-config=MC3R1.R21.14,call_select+=
+{"macro(^memcmp$)&&any_arg(1..2, skip(__non_syntactic_paren_cast_stmts, 
node(string_literal)))",
+ "any()", violation, "%{__callslct_any_base_fmt()}", {{arg, 
"%{__callslct_arg_fmt()}"}}}
+
+-config=MC3R1.R21.15,call_args+=
+{"macro(^mem(cmp|move|cpy)$)", {1, 2}, "unqual_pointee_compatible",
+ "%{__argscmpr_culprit_fmt()}", "%{__argscmpr_evidence_fmt()}"}
+
+-config=MC3R1.R21.16,call_select+=
+{"macro(^memcmp$)&&any_arg(1..2, skip(__non_syntactic_paren_stmts, 
type(canonical(__memcmp_pte_types))))",
+ "any()", violation, "%{__callslct_any_base_fmt()}", 
{{arg,"%{__callslct_arg_type_fmt()}"}}}
+
+-doc_end
+
 -eval_file=toolchain.ecl
 -eval_file=public_APIs.ecl
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.