|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [XEN PATCH 01/13] automation/eclair: consider also hypened fall-through
Update ECLAIR configuration to deviate MISRA C Rule 16.3
using different version of hypened fall-through and search for
the comment for 2 lines after the last statement.
Signed-off-by: Federico Serafini <federico.serafini@xxxxxxxxxxx>
---
automation/eclair_analysis/ECLAIR/deviations.ecl | 2 +-
docs/misra/deviations.rst | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl
b/automation/eclair_analysis/ECLAIR/deviations.ecl
index b8f9155267..b99a6b8a92 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -400,7 +400,7 @@ safe."
-doc_end
-doc_begin="Switch clauses ending with an explicit comment indicating the
fallthrough intention are safe."
--config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\*
[fF]all ?through.? \\*/.*$,0..1))))"}
+-config=MC3R1.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\*
[fF]all[ -]?through.? \\*/.*$,0..2))))"}
-doc_end
-doc_begin="Switch statements having a controlling expression of enum type
deliberately do not have a default case: gcc -Wall enables -Wswitch which warns
(and breaks the build as we use -Werror) if one of the enum labels is missing
from the switch."
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 41cdfbe5f5..411e1fed3d 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -353,6 +353,10 @@ Deviations related to MISRA C:2012 Rules:
However, the use of such comments in new code is deprecated:
the pseudo-keyword "fallthrough" shall be used.
- Tagged as `safe` for ECLAIR. The accepted comments are:
+ - /\* fall-through \*/
+ - /\* Fall-through. \*/
+ - /\* Fall-through \*/
+ - /\* fall-through. \*/
- /\* fall through \*/
- /\* fall through. \*/
- /\* fallthrough \*/
--
2.34.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |