Skip to main content

Compiler Warning C0269

Message: The instance <pointer dereferencing> points to will be reinitialized for virtual function calls. Make sure <pointer dereferencing> doesn't point to a type derived from <base FB>.

Possible error cause: The address of a derived function block is used as the address of the base function block.

Example 463. Example of the warning
FUNCTION_BLOCK FBBase
...

FUNCTION_BLOCK FBDerived EXTENDS FBBase
...

FUNCTION_BLOCK FB EXTENDS Base_FB
...
PROGRAM PLC_PRG
VAR
      pinst : POINTER TO FBBase;
      inst2_2 : FBDerived;
END_VAR
pinst := ADR(inst2_2);
pinst^ := inst2_2;

Pointer dereferencing produces the following warning.

Message:

C0269: The instance pinst^ points to will be reinitialized for virtual function calls. Make sure pinst^ doesn't point to a type derived from FBBase.



: