Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A5-16-1 Clarification
#3
We've just agreed the following reply:  

Regarding your points (1) and (2), the examples do not contradict the rule text as none of them involve assignment expressions.  The example you have provided in (2) and line 9 of the document are initializers and the initializing expressions are not sub-expressions:

 int i;
    int32_t j = (1 ? 2 : 3);  // Compliant
    i = (1 ? 2 : 3);           // Non-compliant


However, we do agree that the rule is overly restrictive and it is possible that the original intent was to be more inline with the original source rule.

This will be reviewed in a future version.
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Messages In This Thread
A5-16-1 Clarification - by hahn - 06-05-2022, 09:12 AM
RE: A5-16-1 Clarification - by hahn - 10-05-2022, 12:29 PM
RE: A5-16-1 Clarification - by misra cpp - 13-05-2022, 01:54 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)