[dmd-internals] Testcase in test42.d

David Nadlinger code at klickverbot.at
Fri Apr 5 17:40:37 PDT 2013


On Sat, Apr 6, 2013 at 2:02 AM, Walter Bright <walter at digitalmars.com> wrote:
> dmd is behaving just like gcc does.

1) I am hardly a C language lawyer, but I can't recall a portion of
the standard where this would be mandated.

2) Clang behaves differently (Clang 3.2, Linux x86_64):
———
   9  .globl s, at OBJECT,COMMON,ALIGN=4,SIZE=16
  10  .globl x, at OBJECT,COMMON,ALIGN=4,SIZE=4
———

3) __alignof(struct S) is (obviously) also 4 for GCC.

I still think that int4 could be an alternative for situations where
you need the extra alignment guarantee, but my main request is that if
you want to keep the test in, that behavior should be reflected in the
spec, so it can be implemented in GDC/LDC without guessing what was
being meant.

David


More information about the dmd-internals mailing list