27-11-2021, 09:18 AM
https://forum.misra.org.uk/thread-1266.html is now visible. The transfer from the old Bulletin Board to the new Discussion Forum lost part of the response which has now been added.
1. An operation is the act of executing an operator. Operators are listed in Section 6.5 of the C99 Language standard.
2. The addition operation is "dead code" since it can be removed. If you do not wish to change your code, it may be appropriate to add a deviation to explain that you understand that "dead code" is present and why you wish to retain it.
3. The current wording does imply that the cast should be removed as it has no effect. However, the next Technical Clarification will include the following exception.
4. The same comments as question 3 apply.
1. An operation is the act of executing an operator. Operators are listed in Section 6.5 of the C99 Language standard.
2. The addition operation is "dead code" since it can be removed. If you do not wish to change your code, it may be appropriate to add a deviation to explain that you understand that "dead code" is present and why you wish to retain it.
3. The current wording does imply that the cast should be removed as it has no effect. However, the next Technical Clarification will include the following exception.
Code:
A cast operator whose result is "used" is not "dead code".
4. The same comments as question 3 apply.
Posted by and on behalf of the MISRA C Working Group