www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11160] New: Bitfield compilation error with degenerate bitfields of length 32 & 64

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11160

           Summary: Bitfield compilation error with degenerate bitfields
                    of length 32 & 64
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: patch
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: safety0ff.bugz gmail.com



According to the documentation the only constraint on bitfields is:
"The sum of all bit lengths in one bitfield instantiation must be exactly 8,
16, 32, or 64."

The current implementation support degenerate bitfields with field lengths 8
and 16.
For example:
mixin(bitfields!(uint, "x", 8, int, "y", 8));
mixin(bitfields!(uint, "x", 8, int, "y", 8, int, "z", 16));

But not with 32 and 64 as length.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 02 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11160




Created an attachment (id=1256)
Proposed fix


used ~0 with shifts.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 02 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11160


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



19:06:06 PDT ---
Dupe of Issue 8474?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 02 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11160





 Dupe of Issue 8474?
This issue is a dupe of 8474, but the code in 8474 includes all kinds of enhancements squashed into a non-atomic commit. The author never created a pull request despite referring to one in the 4 issues mentioned below. In this case, which one should be marked duplicate? Looking at bunch of linked bitmanip bugs referenced in the commit message for the code in issue 8474: Issue 6686 is a dupe of issue 5942, but both should be resolved as worksforme with current std.bitmanip. Issue 4935 also worksforme. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 02 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11160





 The author never created a pull request despite referring to one in the 4
 issues mentioned below.
Actually found the pull requests using google (PR 1045, 719, 734,740.) All closed but don't appear merged. Anyways, using DPaste 6686/ 5942 were fixed between 2.060 and 2.063. 4935 was fixed prior to 2.060. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 02 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11160


safety0ff.bugz gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/phobos/pull/1613

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 03 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11160


David Nadlinger <code klickverbot.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |code klickverbot.at
         Resolution|                            |FIXED



PDT ---
https://github.com/D-Programming-Language/phobos/pull/1613

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