Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clarification of Exception for Rule 10.4
#3
The examples can be expanded as follows:
cha += u8a is the same as cha = cha + u8a
u8a += cha is the same as u8a = u8a + cha

Appendix D ("Addition with char) shows that the essential type of the right hand side of both of these expressions is Essentially character, meaning that the first assignment is permitted but the second is not as it violates Rule 10.2.

The document is incorrect in that it should state that u8a+=cha is compliant with exception 1 of rule 10.4, but violates rule 10.3.
Posted by and on behalf of the MISRA C Working Group
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)