Comment #0 by dlang-bugzilla — 2012-08-20T05:06:21Z
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);
}
Comment #1 by alex — 2012-08-20T05:08:16Z
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.
Comment #3 by dlang-bugzilla — 2012-08-20T05:10:47Z
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...
Comment #4 by alex — 2012-08-20T05:12:44Z
(In reply to comment #3)
> 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?
Comment #5 by dlang-bugzilla — 2012-08-20T05:13:13Z
Please do. My hands are a bit full at the moment...
(In reply to comment #6)
> 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?