[fpc-devel] enums and integer auto conversion

Daniël Mantione daniel.mantione at freepascal.org
Mon Sep 10 22:58:30 CEST 2012



Op Mon, 10 Sep 2012, schreef Jonas Maebe:

>
> On 10 Sep 2012, at 22:06, Daniël Mantione wrote:
>
>>> On Monday 10 September 2012 20:18:52 Vincent Snijders wrote:
>>>> If it is the combination of enum, then the type of the parameter is set of
>>>> enum.
>>> Ahum, I am talking about passing combinations of enums values
>>> (usually bitmasks, assigned enums, some assigned enums
>>> are already combinations of other) to C or C++.
>>> Sets are not binary compatible for that.
>>
>> They should be.
>
> No, sets are an opaque data type. Their internal format is undefined.

I knew you would answer to that :) While, I disagree that a set is opaque, 
but, we can skip that discussion. What's going on here is that, wether it 
is a good idea or not, the implementor of the QT interface units is trying 
to provide Pascal data types to its user. Given the fact you are doing 
that, a set of enum is IMO as reasonable as other weak type to strong type 
mappings.

Daniël


More information about the fpc-devel mailing list