17-01-2018, 04:31 PM
5-2-2 is a rule to protect against undefined behaviour - hence it's required
5-2-3 is more of a style issue. Neither of the two examples shown have undefined behaviour, but arguably the 'good' version that doesn't use the cast is clearer - hence this rule is only advisory
5-2-3 is more of a style issue. Neither of the two examples shown have undefined behaviour, but arguably the 'good' version that doesn't use the cast is clearer - hence this rule is only advisory
Posted by and on behalf of
the MISRA C++ Working Group
the MISRA C++ Working Group