* [XEN PATCH] automation/eclair_enalysis: amend configuration for some MISRA rules
@ 2024-04-29 12:44 Alessandro Zucchelli
2024-04-29 12:49 ` Alessandro Zucchelli
2024-05-01 20:34 ` Stefano Stabellini
0 siblings, 2 replies; 3+ messages in thread
From: Alessandro Zucchelli @ 2024-04-29 12:44 UTC (permalink / raw)
To: xen-devel
Cc: consulting, Alessandro Zucchelli, Simone Ballarin, Doug Goldstein,
Stefano Stabellini
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@bugseng.com>
---
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 a604582da3..f3b634baba 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
if(not(scheduled_analysis),
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [XEN PATCH] automation/eclair_enalysis: amend configuration for some MISRA rules
2024-04-29 12:44 [XEN PATCH] automation/eclair_enalysis: amend configuration for some MISRA rules Alessandro Zucchelli
@ 2024-04-29 12:49 ` Alessandro Zucchelli
2024-05-01 20:34 ` Stefano Stabellini
1 sibling, 0 replies; 3+ messages in thread
From: Alessandro Zucchelli @ 2024-04-29 12:49 UTC (permalink / raw)
To: xen-devel; +Cc: consulting, Simone Ballarin, Doug Goldstein, Stefano Stabellini
On 2024-04-29 14:44, Alessandro Zucchelli wrote:
> 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@bugseng.com>
> ---
> 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 a604582da3..f3b634baba 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
> if(not(scheduled_analysis),
Typo in the title: should be automation/eclair_analysis.
Sorry.
--
Alessandro Zucchelli, B.Sc.
Software Engineer, BUGSENG (https://bugseng.com)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [XEN PATCH] automation/eclair_enalysis: amend configuration for some MISRA rules
2024-04-29 12:44 [XEN PATCH] automation/eclair_enalysis: amend configuration for some MISRA rules Alessandro Zucchelli
2024-04-29 12:49 ` Alessandro Zucchelli
@ 2024-05-01 20:34 ` Stefano Stabellini
1 sibling, 0 replies; 3+ messages in thread
From: Stefano Stabellini @ 2024-05-01 20:34 UTC (permalink / raw)
To: Alessandro Zucchelli
Cc: xen-devel, consulting, Simone Ballarin, Doug Goldstein,
Stefano Stabellini
On Mon, 29 Apr 2024, Alessandro Zucchelli wrote:
> 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@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> ---
> 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 a604582da3..f3b634baba 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
> if(not(scheduled_analysis),
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-01 20:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-29 12:44 [XEN PATCH] automation/eclair_enalysis: amend configuration for some MISRA rules Alessandro Zucchelli
2024-04-29 12:49 ` Alessandro Zucchelli
2024-05-01 20:34 ` Stefano Stabellini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.