Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
2.2 Dead code, 'operations' and casts
#2 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.
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

Messages In This Thread
2.2 Dead code, 'operations' and casts - by ACHart - 21-10-2021, 01:39 PM
RE: 2.2 Dead code, 'operations' and casts - by misra-c - 27-11-2021, 09:18 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)