[fpc-devel] enums and integer auto conversion

Daniël Mantione daniel.mantione at freepascal.org
Tue Sep 11 08:16:37 CEST 2012



Op Tue, 11 Sep 2012, schreef Alexander Klenin:

> On Tue, Sep 11, 2012 at 8:03 AM, Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:
>>
>> If you want to do that, you need to add a layer in between that converts the sets into integer bitmasks in a reliable, portable and future-proof way.
>
> How about packed sets? Do they have well-defined memory layout? If
> not, then maybe they should?

Sets, are a bit more complicated: Their binary layout is defined in 
Borland documentation, but this one of the few issues were FPC didn't 
follow Borland. FPC has smallsets, up to 32 items and longsets, up to 256 
items. This is how it is documented in FPC documentation. Packed is 
ignored on sets and I don't see a need for a packed set with a different 
binary representation, but *should* sets every become unreliable in binary 
representation, I would agree with you that there is a need for a packed 
set that is reliable.

Daniël


More information about the fpc-devel mailing list