Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Example for 12.06 violates 2.3
#3
misra-c Wrote:There are 5 instances of Rule 2.3 violations in the exemplar suite file mc2_12.06.c.

This is an error. The /* sequence should not appear inside the comment.

I count only four, i.e., these ones:

@@ -48,7 +48,7 @@ void mc2_1206 ( void )
}

if ( mc2_1206_boolean_a & mc2_1206_boolean_b ) /* Not Compliant -
- /* bitwise operation on boolean operands */
+ bitwise operation on boolean operands */
{
;
}
@@ -63,18 +63,18 @@ void mc2_1206 ( void )
}

if ( mc2_1206_x && mc2_1206_y ) /* Not compliant -
- /* logical operation on non-boolean operands */
+ logical operation on non-boolean operands */
{
;
}
if ( mc2_1206_x && ( !mc2_1206_y ) ) /* Not compliant -
- /* logical operation on non-boolean operands */
+ logical operation on non-boolean operands */
{
;
}

mc2_1206_x = ( mc2_1206_y == mc2_1206_z ); /* Not compliant -
- /* mc2_1206_x is not effectively boolean */
+ mc2_1206_x is not effectively boolean */
use_uint16 ( mc2_1206_x );

if ( mc2_1206_boolean_a && ( mc2_1206_boolean_b || ( !mc2_1206_boolean_c ) ) )
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)