[dmd-internals] Testcase in test42.d
Walter Bright
walter at digitalmars.com
Fri Apr 5 18:04:03 PDT 2013
On 4/5/2013 5:40 PM, David Nadlinger wrote:
> 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.
It isn't in the C standard.
>
> 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
> ———
That is the same behavior, not different.
>
> 3) __alignof(struct S) is (obviously) also 4 for GCC.
Sure, but still when writing out the section data it aligns it as 16.
>
> 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.
>
I have no issue with putting it in the spec.
More information about the dmd-internals
mailing list