www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8565] New: DMD 2.060 regression: align(1) broken

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

           Summary: DMD 2.060 regression: align(1) broken
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: thecybershadow gmail.com



05:06:21 PDT ---
This works in 2.059 but not in 2.060:

align(1) struct LZMAHeader
{
    uint compressedLength;
    ubyte compressionParameters;
    uint dictionarySize;
    static assert(dictionarySize.offsetof == 5);
    static assert(LZMAHeader.sizeof == 9);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 20 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8565


Alex Rønne Petersen <alex lycus.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |alex lycus.org
         Resolution|                            |INVALID



CEST ---
It's a known (and intended) breaking change. You have to put an align(1):
before the fields of the struct for it to work now.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 20 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8565




CEST ---
To clarify, align outside a struct now only affects the alignment of the struct
itself, not its members. See: http://dlang.org/attribute.html#align

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 20 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8565




05:10:47 PDT ---
Shouldn't there at least be a warning, then? Breaking changes are usually at
least accompanied with a red notice at the top of the changelog...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 20 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8565




CEST ---

 Shouldn't there at least be a warning, then? Breaking changes are usually at
 least accompanied with a red notice at the top of the changelog...
Yeah, good point. This should be noted with red in the change log. Will you make a pull request or should I? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 20 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8565




05:13:13 PDT ---
Please do. My hands are a bit full at the moment...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 20 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8565


Mihail Strashun <m.strashun gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |m.strashun gmail.com



PDT ---
Hm, have noticed this thread via dfeed, can you say something about similar
one:
http://stackoverflow.com/questions/11969058/how-to-fix-this-union-size-alignement-requirement-under-dmd-2-060

I have experimented with code sample there, and aligning both struct and its
members does not work as intended if struct is anonymous. Bug?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 20 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8565




CEST ---

 Please do. My hands are a bit full at the moment...
https://github.com/D-Programming-Language/d-programming-language.org/pull/152 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 20 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8565




CEST ---

 Hm, have noticed this thread via dfeed, can you say something about similar
 one:
 http://stackoverflow.com/questions/11969058/how-to-fix-this-union-size-alignement-requirement-under-dmd-2-060
 
 I have experimented with code sample there, and aligning both struct and its
 members does not work as intended if struct is anonymous. Bug?
I posted a solution on the SO question. I'm not sure if that's a bug or not, but it does look suspicious. Can you file a separate bug, so we can investigate? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 20 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8565




PDT ---
Sure, http://d.puremagic.com/issues/show_bug.cgi?id=8566
( I am not SO question author, just bringing attention to subject )

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