MISRA.COMMAComma operator is used. MISRA C 2012 Rule 12.3: The comma operator should not be used.Use of the comma operator is generally detrimental to the readability of code, and the same effect can be achieved by other means. Category: Advisory Analysis: Decidable, Single Translation Unit Applies to: C90, C99 RationaleUse of the comma operator is generally detrimental to the readability of code, and the same effect can usually be achieved by other means. Examplef ( ( 1, 2 ), 3 ); /* Non-compliant - how many parameters? */ The following example is non-compliant with this rule and other rules:
for ( i = 0, p = &a[ 0 ]; i < N; ++i, ++p ) { } MISRA-C 2004 Rule 12.10 (required): The comma operator shall not be used.Use of the comma operator is generally detrimental to the readability of code, and the same effect can be achieved by other means. MISRA-C++ 2008 Rule 5-18-1 (required): The comma operator shall not be used.RationaleUse of the comma operator is generally detrimental to the readability of code, and the same effect can be achieved by other means. Examplef ( ( 1, 2 ), 3 ); // Non-compliant — how many parameters? |