It's a flexible array member
https://en.wikipedia.org/wiki/Flexible_array_memberIs there a way in FPC to declare a field in a record that takes no space and is there only to provide a way to reference that location in the record ?
No. The "static" part should become the record. The flexible part should be read separately.
You can however, declare an additional structure that would cover for "flexible array member".
mystruct = packed record
a,b: DWORD;
end;
mystruct_full = packed record
hdr : mystruct;
c : array[byte] of DWORD;
end;
as a result you can access "c" array using mystruct_full, BUT
you'll run into a range-check error, (if these are enabled), whenever you'd access c[] outside of declared boundaries (in this case it's "byte", but you could set it to "word")
also, sizeof(mystruct_full) would obviously be greater than sizeof(mystruct)
While sizeof(mystruct) between C and Pascal would match in this case.