Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ccccff
int si = /* some signed value */;
unsigned ui = /* some unsigned value */;
printf("%d\n", (si < 0 || (unsigned)si < ui));

Automated Detection

The tool Compass/ROSE does not currently detect violations of this rule, but it could can by merely reporting comparisons between unsigned integer types and signed integer types.

...