...
| Code Block | ||
|---|---|---|
| ||
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.
...