Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 6-2-3 and C++17 [[fallthrough]]; attribute
#1
Should the C++17 [[fallthrough]]; attribute be given an exception for MISRA C++ 2008 Rule 6-2-3 (a null statement shall appear on a line by itself)?
Reply
#2
The short and unhelpful answer is that [[fallthrough]] was introduced to C++ after MISRA 2008 had been published, so is out of scope of any MISRA 2008 rule.

Having said that, looking at the rationale for 6-2-3, if this were still a requirement, then  "[[fallthrough]]; // comment"    should be acceptable as a null-statement on a single line
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)