27-03-2024, 02:44 PM
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)?
Welcome to the new MISRA discussion forum, if you were previously a member of our forums you may need to reset your password.
Rule 6-2-3 and C++17 [[fallthrough]]; attribute
|
27-03-2024, 02:44 PM
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)?
19-04-2024, 04:48 PM
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 |
« Next Oldest | Next Newest »
|