SA0125: References in initializationsPermalink

Detects reference variables that are used for initialization in the declaration part

Justification: Pointers and references should not be used for initializations because this can lead to access violations if the pointer has not been initialized.

Importance: Medium

Example

PROGRAM PLC_PRG
VAR
	xRef: REFERENCE TO INT;
	iCount: INT := xRef;
END_VAR

--> SA0125: Reference used in initializations