@@ -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.
#
@@ -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.
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@bugseng.com> --- automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++ docs/misra/deviations.rst | 8 ++++++++ 2 files changed, 12 insertions(+)