http://d.puremagic.com/issues/show_bug.cgi?id=3183
--- Comment #2 from Stewart Gordon <s...@iname.com> 2009-08-31 04:57:28 PDT --- (In reply to comment #1) > 2. There's always a companion C compiler, as D relies on the existence of the > C > runtime library. So a prerequisite for writing a D compiler from scratch is to write a C compiler first? Still, that doesn't answer my question beyond the first 7 words. > 3. It's the way the companion C compiler aligns. Still, that this may be absolute or relative depending on the companion C compiler ought to be mentioned in the D spec at least to crack down on the user confusion of which I have been a victim. > 4. Unions members are all at offset 0. Unions are aligned according to the > alignment of their largest field. You mean aligned in a containing struct, or aligned absolutely _if_ the implementation interprets alignment as absolute? Neither seems to be happening in my test (1.046): ---------- align(1) struct Qwert { byte b1; align(1) struct { byte b2; union { align (4) struct { int i; } } } } pragma(msg, "Qwert.alignof == " ~ Qwert.alignof.stringof); pragma(msg, "Qwert.b1.alignof == " ~ Qwert.b1.alignof.stringof); pragma(msg, "Qwert.b2.alignof == " ~ Qwert.b2.alignof.stringof); pragma(msg, "Qwert.i.alignof == " ~ Qwert.i.alignof.stringof); pragma(msg, "Qwert.b1.offsetof == " ~ Qwert.b1.offsetof.stringof); pragma(msg, "Qwert.b2.offsetof == " ~ Qwert.b2.offsetof.stringof); pragma(msg, "Qwert.i.offsetof == " ~ Qwert.i.offsetof.stringof); ---------- Qwert.alignof == 1u Qwert.b1.alignof == 1u Qwert.b2.alignof == 1u Qwert.i.alignof == 4u Qwert.b1.offsetof == 0u Qwert.b2.offsetof == 1u Qwert.i.offsetof == 2u ---------- But to both 4 and 5, I said "should", i.e. I was pondering over what's desirable and whether the spec ought to be changed, not what the current spec or behaviour is. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------