SA0055: Unnecessary comparisons of unsigned operandsPermalink

Detects unnecessary comparisons with unsigned operands. An unsigned data type is never less than zero. This can be used as a sign check.

Justification: A comparison detected with this check yields a constant result and is an indication of an error in the code.

Importance: High

Example

PROGRAM PLC_PRG
VAR
 byTest: BYTE; 
END_VAR

WHILE byTest >= 0 DO
	byTest := byTest - 1;
END_WHILE;

--> SA0055: Unnecessary comparisons of unsigned operands