gpc-20030830 and packed records

Adriaan van Os gpc at microbizz.nl
Sat Dec 13 22:53:03 CET 2003


Prof A Olowofoyeku (The African Chief) wrote:

> On 13 Dec 2003 at 17:34, Frank Heckenbach wrote:
> [...]
>>> produces this compiler error:
>>> packer.pas: In main program:
>>> packer.pas:10: cannot take address of packed record field `sig'
>>
>> The error seems correct. Converting an array of Char to CString
>> means taking the address.
> [...]
> Hmm ... This has just broken my unzip sources. The record has to be
> packed, and I have to do things (e.g., as above) with the signature
> field. I guess I either have to convert all the code so that it will
> compile with "--delphi", or find some other hack to circumvent this :/

I know that the Pascal Standard forbids taking the address of a field 
in a packed record. However, from a practical point of view I have 
always felt this is a rather clumsy restriction, unless of course the 
address is not byte aligned. Some Pascal implementations take the 
pragmatic course and allow taking the address of a field in a packed 
record if it is byte aligned. Is there any compelling reason why we 
should not allow this, except in Standard or Extended Pascal mode ?

Regards,

Adriaan van Os




More information about the Gpc mailing list