Re: [fpc-pascal] Implementation of variant records

2019-07-07 Thread Sven Barth via fpc-pascal
Am 07.07.2019 um 12:54 schrieb Sven Barth: Am 07.07.2019 um 02:55 schrieb Ralf Quint: On 7/6/2019 12:21 PM, Florian Klaempfl wrote: Am 05.07.2019 um 13:53 schrieb Ralf Quint: Shouldn't a PACKED Record guarantee that values are aligned at the byte level? It does in TP, but the ISO says only t

Re: [fpc-pascal] Implementation of variant records

2019-07-07 Thread Sven Barth via fpc-pascal
Am 07.07.2019 um 02:55 schrieb Ralf Quint: On 7/6/2019 12:21 PM, Florian Klaempfl wrote: Am 05.07.2019 um 13:53 schrieb Ralf Quint: Shouldn't a PACKED Record guarantee that values are aligned at the byte level? It does in TP, but the ISO says only that it shall be economised. Well, the ISO is

Re: [fpc-pascal] Implementation of variant records

2019-07-06 Thread Ralf Quint
On 7/6/2019 12:21 PM, Florian Klaempfl wrote: Am 05.07.2019 um 13:53 schrieb Ralf Quint: Shouldn't a PACKED Record guarantee that values are aligned at the byte level? It does in TP, but the ISO says only that it shall be economised. Well, the ISO is probably what has done most of the damage t

Re: [fpc-pascal] Implementation of variant records

2019-07-06 Thread Florian Klaempfl
Am 05.07.2019 um 13:53 schrieb Ralf Quint: > 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

Re: [fpc-pascal] Implementation of variant records

2019-07-05 Thread Ralf Quint
On 7/5/2019 5:07 AM, Marco van de Voort wrote: Op 2019-07-05 om 13:53 schreef Ralf Quint: 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.

Re: [fpc-pascal] Implementation of variant records

2019-07-05 Thread Marco van de Voort
Op 2019-07-05 om 13:53 schreef Ralf Quint: 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 lang

Re: [fpc-pascal] Implementation of variant records

2019-07-05 Thread Ralf Quint
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 sta

Re: [fpc-pascal] Implementation of variant records

2019-07-05 Thread Marco van de Voort
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

Re: [fpc-pascal] Implementation of variant records

2019-07-05 Thread Tomas Hajny
On 2019-07-05 11:49, Bernd Oppolzer wrote: This question is not directly related to FPC, but it is instead a Pascal question in general. . . BTW: is there a forum to discuss general Pascal questions not directly related to the FPC product? FPC-Pascal will sure be the largest auditorium availa

[fpc-pascal] Implementation of variant records

2019-07-05 Thread Bernd Oppolzer
This question is not directly related to FPC, but it is instead a Pascal question in general. Take this record definition: type S1 = record     X : CHAR ( 27 ) ;     case INTEGER of   1 :     ( V : INTEGER ) ;   2 :     ( W : REAL