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

[xen staging] misra: deviate violations of Rule 21.6



commit 047a94b3fe4def68fd8220cd92154ba510969826
Author:     Federico Serafini <federico.serafini@xxxxxxxxxxx>
AuthorDate: Tue Jul 1 19:50:53 2025 +0000
Commit:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
CommitDate: Thu Jul 3 14:45:45 2025 -0700

    misra: deviate violations of Rule 21.6
    
    MISRA C Rule 21.6 states that "The Standard Library input/output
    functions shall not be used".
    
    Xen does not use the functions provided by the Standard Library,
    uses -nostdlib to ensure this.
    Xen implements a set of functions that share the same names as their
    Standard Library equivalent. The implementation of these functions is
    available in source form: if some undefined or unspecified behavior
    does arise in the implementation, it falls under the jurisdiction of
    other MISRA guidelines.
    
    Update ECLAIR configuration to deviate violations of the rule,
    tag it as clean and add it to the monitored set.
    
    Updated docs/misra/deviations.rst accordingly.
    
    Signed-off-by: Federico Serafini <federico.serafini@xxxxxxxxxxx>
    Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl |  3 ++-
 automation/eclair_analysis/ECLAIR/monitored.ecl  |  1 +
 automation/eclair_analysis/ECLAIR/tagging.ecl    |  1 +
 docs/misra/deviations.rst                        | 11 ++++++++++-
 4 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl 
b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 9c67358d46..3a4d9ee3c0 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -650,7 +650,8 @@ implements a set of functions that share the same names as 
their Standard Librar
 The implementation of these functions is available in source form, so the 
undefined, unspecified
 or implementation-defined behaviors contemplated by the C Standard do not 
apply.
 If some undefined or unspecified behavior does arise in the implementation, it
-falls under the jurisdiction of other MISRA rules."
+falls under the jurisdiction of other MISRA guidelines."
+-config=MC3A2.R21.6,reports+={deliberate, "any()"}
 -config=MC3A2.R21.9,reports+={deliberate, "any()"}
 -config=MC3A2.R21.10,reports+={deliberate, "any()"}
 -doc_end
diff --git a/automation/eclair_analysis/ECLAIR/monitored.ecl 
b/automation/eclair_analysis/ECLAIR/monitored.ecl
index ca2f5e3c7f..e2ad224d79 100644
--- a/automation/eclair_analysis/ECLAIR/monitored.ecl
+++ b/automation/eclair_analysis/ECLAIR/monitored.ecl
@@ -82,6 +82,7 @@
 -enable=MC3A2.R20.14
 -enable=MC3A2.R21.3
 -enable=MC3A2.R21.4
+-enable=MC3A2.R21.6
 -enable=MC3A2.R21.5
 -enable=MC3A2.R21.7
 -enable=MC3A2.R21.8
diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl 
b/automation/eclair_analysis/ECLAIR/tagging.ecl
index f9da5d5f4d..5bf214f480 100644
--- a/automation/eclair_analysis/ECLAIR/tagging.ecl
+++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
@@ -93,6 +93,7 @@ MC3A2.R20.14||
 MC3A2.R21.3||
 MC3A2.R21.4||
 MC3A2.R21.5||
+MC3A2.R21.6||
 MC3A2.R21.7||
 MC3A2.R21.8||
 MC3A2.R21.9||
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index fe0b1e10a2..6cd8f48c91 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -587,7 +587,16 @@ Deviations related to MISRA C:2012 Rules:
        construct is deviated only in Translation Units that present a violation
        of the Rule due to uses of this macro.
      - Tagged as `deliberate` for ECLAIR.
-     
+
+   * - R21.6
+     - Xen does not use the input/output functions provided by the C
+       Standard Library, but provides in source form its own implementation,
+       therefore any unspecified or undefined behavior associated to the
+       functions provided by the Standard Library does not apply. Any such
+       behavior that may exist in such functions is therefore under the
+       jurisdiction of other MISRA C guidelines.
+     - Tagged as `deliberate` for ECLAIR.
+
    * - R21.9
      - Xen does not use the `bsearch` and `qsort` functions provided by the C
        Standard Library, but provides in source form its own implementation,
--
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®.