Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
12.6 boolean expression assigned to int example
#1
Code:
uint16_t mc2_1206_x;
   uint16_t mc2_1206_y;
   uint16_t mc2_1206_z;
   mc2_1206_x = ( mc2_1206_y == mc2_1206_z ); /* Not compliant - mc2_1206_x is not effectively boolean */

This code has been marked as violation of rule 12.6 but I fail to see why. There are no (&&, || and !) operators so the first part of the rule does not apply. The boolean expression is used as operand of "=" so the second part of the rule is complied to as well.
Please correct me if I'm wrong.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)