Message ID | 8b1e260ebc77efe3d317dd66a09045056f2acbfc.1725977659.git.alessandro.zucchelli@bugseng.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [XEN] automation/eclair: add deviation for MISRA C 2012 Dir 4.10 | expand |
On Tue, 10 Sep 2024, Alessandro Zucchelli wrote: > Add deviation to address violations of MISRA C:2012 Directive 4.10 > ("Precautions shall be taken in order to prevent the contents of a > header file being included more than once"). > > This deviation suppresses the violation arising from autogenerated file > xen/include/generated/autoconf.h > > No functional change. > > Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com> > --- > automation/eclair_analysis/ECLAIR/deviations.ecl | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl > index 9051f41602..165322811c 100644 > --- a/automation/eclair_analysis/ECLAIR/deviations.ecl > +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl > @@ -76,6 +76,7 @@ they are not instances of commented-out code." > conform to the directive." > -config=MC3R1.D4.10,reports+={safe, "first_area(text(^/\\* This file is legitimately included multiple times\\. \\*/$, begin-4))"} > -config=MC3R1.D4.10,reports+={safe, "first_area(text(^/\\* Generated file, do not edit! \\*/$, begin-3))"} > +-config=MC3R1.D4.10,reports+={safe, "all_area(all_loc(file(^xen/include/generated/autoconf.h$)))"} > -doc_end > > -doc_begin="Including multiple times a .c file is safe because every function or data item If we add xen/include/generated/autoconf.h to docs/misra/exclude-list.json, could we skip this change? If yes, then it is better to add xen/include/generated/autoconf.h to exclude-list.json. If not, then this is fine as is: Acked-by: Stefano Stabellini <sstabellini@kernel.org>
diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl index 9051f41602..165322811c 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -76,6 +76,7 @@ they are not instances of commented-out code." conform to the directive." -config=MC3R1.D4.10,reports+={safe, "first_area(text(^/\\* This file is legitimately included multiple times\\. \\*/$, begin-4))"} -config=MC3R1.D4.10,reports+={safe, "first_area(text(^/\\* Generated file, do not edit! \\*/$, begin-3))"} +-config=MC3R1.D4.10,reports+={safe, "all_area(all_loc(file(^xen/include/generated/autoconf.h$)))"} -doc_end -doc_begin="Including multiple times a .c file is safe because every function or data item
Add deviation to address violations of MISRA C:2012 Directive 4.10 ("Precautions shall be taken in order to prevent the contents of a header file being included more than once"). This deviation suppresses the violation arising from autogenerated file xen/include/generated/autoconf.h No functional change. Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com> --- automation/eclair_analysis/ECLAIR/deviations.ecl | 1 + 1 file changed, 1 insertion(+)