Back

LL083

Mixed signedness comparison

Object Pascal — Delphi & Free Pascal
Warning
Reliability

Comparing signed and unsigned integers can produce unexpected results with negative values

comparing signed and unsigned integers can produce unexpected results with negative values.

Why this severity

comparing signed and unsigned integers can produce unexpected results with negative values.


Known false positives

values known to be non-negative by domain constraints.

Remediation example

var
  A: Integer;
  B: Integer; // match types to avoid mixed signedness

Reconnecting… Connection lost. Reload