Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Example for 12.06 violates 2.3
#1
It seems that the comments in mc2_12.06.c violate Rule 2.3:
if ( mc2_1206_boolean_a & mc2_1206_boolean_b ) /* Not Compliant -
/* bitwise operation on boolean operands */
{
;
}

Regards,

Andreas
<t></t>
Reply
#2
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.
Posted by and on behalf of the MISRA C Working Group
Reply
#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
#4
You are correct - there are 4 instances, not 5.
Posted by and on behalf of the MISRA C Working Group
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)