Thanks! Your example does compile, but if you replace 31 with 32 - it will not compile - no matter what you use - integer, int64 or qword
And I guess I know the reason now - sizeof(left) should be equal to sizeof(right) and 33 bits enum has sizeof of 5 :( Any suggestions? Thanks, Gennady On Tue, Jul 22, 2014 at 12:13 PM, Marco van de Voort <[email protected]> wrote: > In our previous episode, Gennady Agranov said: > > > > > > Good. And afaik in Delphi mode this works too in FPC? Did you test? > > > > > > > casting integer to set does not compile in FPC - and yes - I use Delphi > > mode :( > > program setcast; > > {$ifdef FPC} > {$mode delphi} > {$else} > {$APPTYPE CONSOLE} > {$endif} > > uses > SysUtils; > > type tenum=0..31; > tmyset= set of tenum; > > var x:integer; > y:tmyset; > > begin > x:=integer(y); > end. > > compiles in both FPC (both 2.6.x and trunk) and Delphi (XE4) > > _______________________________________________ > fpc-devel maillist - [email protected] > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel >
_______________________________________________ fpc-devel maillist - [email protected] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
