extremely likely that the programmer did not intend to put the semi-colon there. C.26.2 Guidance to language users Simplify statements with interspersed comments to aid in accurately programming functionality and help future maintainers understand the intent and nuances of the code. The flexibility of C permits a programmer to create extremely complex expressions. Assignments embedded within other statements can be potentially problematic. Each of the following  would be clearer and have less potential for problems if the embedded assignments were conducted outside of the expressions: int a,b,c,d; /* */ … if ((a == b) || (c = (d-1))) /* the assignment to c may not occur */ /* if a is to b */ or: int a,b,c; /* */ … foo (a=b, c); Each is a valid C statement, but each may have unintended results. Null statements should have a source line of their own. This, combined with enforcement by static  analysis, would make clearer the intention that the statement was meant to be a null statement. C.27 Dead and Deactivated Code [XYQ] C.27.1 Applicability to language As with any programming language that contains branching statements, C programs can potentially contain dead code. It is of concern primarily since dead code may reveal a logic flaw or an unintentional mistake on the part of the programmer. Sometimes statements can be inserted in C programs as defensive programming such as adding a default case to a switch statement even though the expectation is that the default can never be reached until – through some twist of logic or through modifications to the code the notifying error message reveals the surprising event. These types of defensive statements may be able to be shown to be computationally impossible and thus are dead code. Those are not the focus. The focus is on those statements which are not defensive and which are unreachable. It is impossible to identify all such cases and therefore only those which are blatant and that indicate deeper issues of flawed logic may be able to be identified and removed. C uses some operators that can be confused with other operators. For instance, the common mistake of using an assignment operator in a Boolean test as in: int a,b; /* */ … if (a = b) … can portions of code to become dead code since unless can contain the value 0, the portion of the b else if
extremely likely that the programmer did not intend to put the semi-colon there. C.26.2 Guidance to language users Simplify statements with interspersed comments to aid in accurately programming functionality and help future maintainers understand the intent and nuances of the code. The flexibility of C permits a programmer to create extremely complex expressions.  Assignments embedded within other statements can be potentially problematic. Each of the following would be clearer and have less potential for problems if the embedded assignments were conducted outside of the expressions: int a,b,c,d; /* … */ if ((a == b) || (c = (d-1))) /* the assignment to c may not occur */ /* if a is to b */ or: int a,b,c; /* … */ foo (a=b, c); Each is a valid C statement, but each may have unintended results.  Null statements should have a source line of their own. This, combined with enforcement by static analysis, would make clearer the intention that the statement was meant to be a null statement. C.27 Dead and Deactivated Code [XYQ] C.27.1 Applicability to language As with any programming language that contains branching statements, C programs can potentially contain dead code. It is of concern primarily since dead code may reveal a logic flaw or an unintentional mistake on the part of the programmer. Sometimes statements can be inserted in C programs as defensive programming such as adding a default case to a switch statement even though the expectation is that the default can never be reached – until through some twist of logic or through modifications to the code the notifying error message reveals the surprising event. These types of defensive statements may be able to be shown to be computationally impossible and thus are dead code. Those are not the focus. The focus is on those statements which are not defensive and which are unreachable. It is impossible to identify all such cases and therefore only those which are blatant and that indicate deeper issues of flawed logic may be able to be identified and removed. C uses some operators that can be confused with other operators. For instance, the common mistake of using an assignment operator in a Boolean test as in: int a,b; /* … */ if (a = b) … can portions of code to become dead code since unless b can contain the value 0, the else portion of the if
ISO-IECJTC1-SC22-WG23_N0295-meeting-markup-c-annex-2010-12-15.docx