|
From: | Richard Henderson |
Subject: | Re: [Qemu-devel] [PATCH 2/6] scripts/update-linux-headers: Handle __aligned_u64 |
Date: | Fri, 25 May 2018 07:55:21 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 05/25/2018 06:27 AM, Peter Maydell wrote: > We'll currently replace any 'u64' with a 'uint64_t' including when > it's embedded in an '__aligned_u64', creating a '__aligned_uint64_t' > which doesn't exist. We need to instead expand out the kernel's > definition of __aligned_u64: > #define __aligned_u64 __u64 __attribute__((aligned(8))) > before we convert the __u64 to uint64_t. Wow. I did not believe that would work. I expected that you'd need to define a typedef, or somehow sort the attribute after the identifier to which it applies. However typedef unsigned long uint64_t; uint64_t __attribute__((aligned(16))) a; struct bar { uint64_t __attribute__((aligned(16))) foo; } b; produces the expected alignments with both gcc(8) and clang(6). Reviewed-by: Richard Henderson <address@hidden> r~
[Prev in Thread] | Current Thread | [Next in Thread] |