Describe the bug
REF_TO array is incorrectly generated, see the below example.
To Reproduce
Following function in PLC:
FUNCTION Util_PackBitsToDWORD : ErrorCode
VAR_INPUT
ValueRef: REF_TO ARRAY [*] OF BOOL;
StartIndex: INT := 0;
Length: INT := 32;
Offset: INT := 0;
END_VAR
VAR_OUTPUT
Result: DWORD;
END_VAR
END_FUNCTION
which is generated into:
void Util_PackBitsToDWORD(ErrorCode *Util_PackBitsToDWORD, __Util_PackBitsToDWORD_ValueRef_ *ValueRef,
int16_t StartIndex, int16_t Length, int16_t Offset, uint32_t *Result);
The second argument will then lead to:
error: unknown type name '__Util_PackBitsToDWORD_ValueRef_'.
Expected behavior
From the above example, I would expect a bool* ValueRef to be generated instead of the __Util_PackBitsToDWORD_ValueRef_ *ValueRef.
Additional context
Originally reported by Guillaume.
Describe the bug
REF_TO array is incorrectly generated, see the below example.
To Reproduce
Following function in PLC:
which is generated into:
The second argument will then lead to:
error: unknown type name '__Util_PackBitsToDWORD_ValueRef_'.Expected behavior
From the above example, I would expect a
bool* ValueRefto be generated instead of the__Util_PackBitsToDWORD_ValueRef_ *ValueRef.Additional context
Originally reported by Guillaume.