Detects comparisons with literals that always have the result TRUE
or FALSE
, and can already be processed during at the compile.
Justification: An operation that consistently yields TRUE
or FALSE
is an indication of a programming error.
Importance: High
Example
PROGRAM PLC_PRG VAR byTemp1 : BYTE; END_VAR WHILE byTemp1 <= 255 DO byTemp1 := byTemp1 + 1; END_WHILE; --> SA0059: Relational operator '<=' always evaluates 'TRUE'