diff mbox series

[XEN,v2,7/7] automation/eclair_analysis: avoid violation of MISRA Rule 2.1

Message ID 6bf425b3d01dc16297ef45e58c03b3ffd803b9e0.1702891792.git.nicola.vetrini@bugseng.com (mailing list archive)
State New, archived
Headers show
Series address violations of MISRA C:2012 Rule 2.1 | expand

Commit Message

Nicola Vetrini Dec. 18, 2023, 10:17 a.m. UTC
The presence of an unlinked object file triggers a violation
of MISRA C Rule 2.1, which is deviated, as it's not part of
the final Xen binary.

No functional change.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Stefano Stabellini Dec. 19, 2023, 1:40 a.m. UTC | #1
On Mon, 18 Dec 2023, Nicola Vetrini wrote:
> The presence of an unlinked object file triggers a violation
> of MISRA C Rule 2.1, which is deviated, as it's not part of
> the final Xen binary.
> 
> No functional change.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  automation/eclair_analysis/ECLAIR/deviations.ecl | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
> index 85741a2c01a9..e3de0fb2adf8 100644
> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
> @@ -28,6 +28,11 @@ not executable, and therefore it is safe for them to be unreachable."
>  -config=MC3R1.R2.1,ignored_stmts+={"any()", "pure_decl()"}
>  -doc_end
>  
> ++-doc_begin="The following autogenerated file is not linked deliberately."
> ++-file_tag+={C_runtime_failures,"^automation/eclair_analysis/C-runtime-failures\\.rst\\.c$"}
> ++-config=MC3R1.R2.1,reports+={deliberate, "any_area(any_loc(file(C_runtime_failures)))"}
> ++-doc_end
> +
>  -doc_begin="Proving compliance with respect to Rule 2.2 is generally impossible:
>  see https://arxiv.org/abs/2212.13933 for details. Moreover, peer review gives us
>  confidence that no evidence of errors in the program's logic has been missed due
> -- 
> 2.34.1
>
Stefano Stabellini Dec. 19, 2023, 1:43 a.m. UTC | #2
On Mon, 18 Dec 2023, Stefano Stabellini wrote:
> On Mon, 18 Dec 2023, Nicola Vetrini wrote:
> > The presence of an unlinked object file triggers a violation
> > of MISRA C Rule 2.1, which is deviated, as it's not part of
> > the final Xen binary.
> > 
> > No functional change.
> > 
> > Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> 
> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> 
> > ---
> >  automation/eclair_analysis/ECLAIR/deviations.ecl | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
> > index 85741a2c01a9..e3de0fb2adf8 100644
> > --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
> > +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
> > @@ -28,6 +28,11 @@ not executable, and therefore it is safe for them to be unreachable."
> >  -config=MC3R1.R2.1,ignored_stmts+={"any()", "pure_decl()"}
> >  -doc_end
> >  
> > ++-doc_begin="The following autogenerated file is not linked deliberately."
> > ++-file_tag+={C_runtime_failures,"^automation/eclair_analysis/C-runtime-failures\\.rst\\.c$"}
> > ++-config=MC3R1.R2.1,reports+={deliberate, "any_area(any_loc(file(C_runtime_failures)))"}
> > ++-doc_end

Would it make sense to add it to exclude-list instead?
Nicola Vetrini Dec. 19, 2023, 8 a.m. UTC | #3
On 2023-12-19 02:43, Stefano Stabellini wrote:
> On Mon, 18 Dec 2023, Stefano Stabellini wrote:
>> On Mon, 18 Dec 2023, Nicola Vetrini wrote:
>> > The presence of an unlinked object file triggers a violation
>> > of MISRA C Rule 2.1, which is deviated, as it's not part of
>> > the final Xen binary.
>> >
>> > No functional change.
>> >
>> > Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> 
>> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
>> 
>> 
>> > ---
>> >  automation/eclair_analysis/ECLAIR/deviations.ecl | 5 +++++
>> >  1 file changed, 5 insertions(+)
>> >
>> > diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
>> > index 85741a2c01a9..e3de0fb2adf8 100644
>> > --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
>> > +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
>> > @@ -28,6 +28,11 @@ not executable, and therefore it is safe for them to be unreachable."
>> >  -config=MC3R1.R2.1,ignored_stmts+={"any()", "pure_decl()"}
>> >  -doc_end
>> >
>> > ++-doc_begin="The following autogenerated file is not linked deliberately."
>> > ++-file_tag+={C_runtime_failures,"^automation/eclair_analysis/C-runtime-failures\\.rst\\.c$"}
>> > ++-config=MC3R1.R2.1,reports+={deliberate, "any_area(any_loc(file(C_runtime_failures)))"}
>> > ++-doc_end
> 
> Would it make sense to add it to exclude-list instead?

I don't think so, because if some documentation about runtime error that 
is supposed to be here is missing it won't be obvious that the file that 
needs to be fixed is this. Moreover, you'd need to put the path of the 
generated .c file there, which I'm not sure how well it would behave 
w.r.t. other tooling.
diff mbox series

Patch

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 85741a2c01a9..e3de0fb2adf8 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -28,6 +28,11 @@  not executable, and therefore it is safe for them to be unreachable."
 -config=MC3R1.R2.1,ignored_stmts+={"any()", "pure_decl()"}
 -doc_end
 
++-doc_begin="The following autogenerated file is not linked deliberately."
++-file_tag+={C_runtime_failures,"^automation/eclair_analysis/C-runtime-failures\\.rst\\.c$"}
++-config=MC3R1.R2.1,reports+={deliberate, "any_area(any_loc(file(C_runtime_failures)))"}
++-doc_end
+
 -doc_begin="Proving compliance with respect to Rule 2.2 is generally impossible:
 see https://arxiv.org/abs/2212.13933 for details. Moreover, peer review gives us
 confidence that no evidence of errors in the program's logic has been missed due