[fpc-pascal] Implementation of variant records

Ralf Quint freedos.la at gmail.com
Fri Jul 5 13:53:21 CEST 2019


On 7/5/2019 3:27 AM, Marco van de Voort wrote:
>
> Op 2019-07-05 om 11:49 schreef Bernd Oppolzer:
>>
>> IMO, the variants in a variant record should always overlay correctly 
>> (like unions in C),
>> so the variant part should start at offset 32 in this case, and this 
>> is where all three
>> variants should start.
>
> This is not a guarantee case in the Pascal language, afaik many old 
> compilers don't even try, but make fields sequential.
>
> As soon as you have expections of overlaying, you are dialect and 
> architecture specific. 

Shouldn't a PACKED Record guarantee that values are aligned at the byte 
level?

Ralf


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the fpc-pascal mailing list