SA0026: Possible truncated strings

Function

Determines string assignments and initializations that do not use an adequate string length.

Reason

If strings of different lengths are assigned, a string may be truncated. The result is then not the expected one.

Importance

Medium

Samples:

PROGRAM MAIN
VAR
    sVar1  : STRING[10];
    sVar2  : STRING[6];
    sVar3  : STRING[6] := 'abcdefghi';              // => SA0026
END_VAR
sVar2 := sVar1;                                     // => SA0026