Detecta la adición de punteros
Justificación: En CODESYS, la aritmética de punteros está generalmente permitida y también puede utilizarse adecuadamente. Sin embargo, también es una fuente de errores. Por lo tanto, existen reglas de programación que prohíben generalmente la aritmética de punteros. Esta prueba puede comprobar tal requisito.
Importancia: Medio
Ejemplo
PROGRAM PLC_PRG
VAR
iTest:INT;
ariTest:ARRAY[0..10] OF INT;
{attribute 'analysis':='-111'}
piTest:POINTER TO INT;
i:INT;
END_VAR
piTest := ADR(ariTest[0]); // OK
piTest^:= 0;
piTest := ADR(ariTest) + SIZEOF(INT); // SA0064
piTest^:= 1;
piTest := ADR(ariTest) + 6; // SA0064
piTest^:= 3;
piTest := ADR(ariTest[10]);
FOR i:=0 TO 10 DO
piTest^ := i;
piTest := piTest + 2; // SA0064
END_FOR
--> SA0064: Addition of pointer