Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A5-16-1 Clarification
#1
Hi,

we stumbled upon a few situations in which rule A5-16-1 is not particularly clear.

(1) The example contradicts the rule text as the usage of ?: as sub-expression in assignments (which is an expression again) is named compliant. This was already mentioned in https://forum.misra.org.uk/thread-1612.html .
(2) Code like "A a = 1 ? x : y;" where A is a class and x and y are objects of A. Assuming assignments are okay for this rule, the ?: is not the operand of the assignment but of an implicit call to the copy constructor of A. Should such implicit calls be ignored (aka treated as transparent) or is the rule okay with usage of ?: as function call argument in general?

It would be great if the exceptions for this rule could be clarified. Thanks a lot!
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)