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

[XEN PATCH] docs/misra: deviate deliberately unused labels



The labels marked with __maybe_unused are either used only
in certain build configurations or deliberately unused.
See the justification in docs/misra/deviations.rst.

No functional changes.

Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++
 docs/misra/deviations.rst                        | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl 
b/automation/eclair_analysis/ECLAIR/deviations.ecl
index c9e3a90801aa..f18ed6345e67 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -37,6 +37,10 @@ removed by the compiler, the resulting slowdown is 
negligible."
 -config=MC3R1.R2.2,reports+={disapplied,"any()"}
 -doc_end
 
+-doc_begin="Some labels are unused in certain build configurations, or are 
deliberately marked as unused, so that the compiler is entitled to remove them."
+-config=MC3R1.R2.6,reports+={deliberate, 
"any_area(text(^.*__maybe_unused.*$))"}
+-doc_end
+
 #
 # Series 3.
 #
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 160513b997ae..9979ddae7c7d 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -73,6 +73,14 @@ Deviations related to MISRA C:2012 Rules:
        resulting slowdown is negligible.
      - Project-wide deviation, tagged as `disapplied` for ECLAIR.
 
+   * - R2.6
+     - Labels deliberately marked as unused trough the pseudo-attribute
+       `__maybe_unused` are either the result of them not being in certain 
build
+       configurations, or as a deliberate practice (e.g., 
`unimplemented_insn`).
+       Given that the compiler is then entitled to remove them, the presence of
+       such labels poses no risks.
+     - Tagged as `deliberate` for ECLAIR.
+
    * - R3.1
      - Comments starting with '/\*' and containing hyperlinks are safe as they
        are not instances of commented-out code.
-- 
2.34.1




 


Rackspace

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