[Issue 8474] bitfields doesn't work with bitfield over 31 bits

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 31 04:40:15 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8474


monarchdodra at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |monarchdodra at gmail.com


--- Comment #1 from monarchdodra at gmail.com 2012-07-31 04:40:13 PDT ---
FYI: Bitfileds DO work with fields over 32. They just don't work for fields
that are EXACTLY 32.

The problem is that since the field is 32 bits long, it is placed in a uint.
When trying to create the "signed mask" though the "1" is attempted to be
placed at index 32 (1 << 32), which becomes illegal.

The problem does not appear if the field is SMALLER than 32, since the mask
will fit.
The problem does not appear if the field is BIGGER than 32, the type will be
placed in a ulong.

Oh yeah, and fields that are exactly 64 bits long don't work either. This is
arguably less of a problem though... but still wrong.

=>Changing title

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list