@@ -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."
@@ -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 \*/
Update ECLAIR configuration: - allow to deviate MISRA C Rule 16.3 using different version of hypened fall-through; - search for the comment for 2 lines after the last statement. Signed-off-by: Federico Serafini <federico.serafini@bugseng.com> --- automation/eclair_analysis/ECLAIR/deviations.ecl | 2 +- docs/misra/deviations.rst | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-)