Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 7.0.5: add exception for modulo operand
#1
As I understand this code is non-compliant:
Code:
u8a % u8b

I wonder if some exception would be acceptable such as:
modulo and bitand operations are compliant when both operands are unsigned. the result shall be considered to be unsigned.

That would make such code compliant:
Code:
  if ((u8a % u8b) == 0U)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)