>>> On 12.02.16 at 16:25, <andrew.coop...@citrix.com> wrote: > Hello, > > Now that Clang 3.5 can build the hypervisor, I was just preparing a > patch to README, and encountered this: > > In file included from xc_altp2m.c:23: > In file included from ./xc_private.h:35: > In file included from ./include/xenctrl.h:53: > /local/xen.git/tools/libxc/../../tools/include/xen/foreign/x86_64.h:203:47: > error: 'aligned' attribute ignored when parsing type > [-Werror,-Wignored-attributes] > __align8__ uint64_t evtchn_pending[sizeof(__align8__ uint64_t) * 8]; > ^~~~~~~~~~ > /local/xen.git/tools/libxc/../../tools/include/xen/foreign/x86_64.h:13:36: > note: expanded from macro '__align8__' > # define __align8__ __attribute__((aligned (8))) > ^~~~~~~~~~~ > /local/xen.git/tools/libxc/../../tools/include/xen/foreign/x86_64.h:204:44: > error: 'aligned' attribute ignored when parsing type > [-Werror,-Wignored-attributes] > __align8__ uint64_t evtchn_mask[sizeof(__align8__ uint64_t) * 8]; > ^~~~~~~~~~ > /local/xen.git/tools/libxc/../../tools/include/xen/foreign/x86_64.h:13:36: > note: expanded from macro '__align8__' > # define __align8__ __attribute__((aligned (8))) > ^~~~~~~~~~~ > 2 errors generated. > > In this case, Clang is complaining that the alignment attribute is wrong > for uint64_t. This is correct for 64bit compilations, but wrong for > 32bit.
If it only complains about it when used as operand to sizeof() I think it's correctly saying so. > On the other hand, I am not sure whether it is sensible to do a > blanket disable of -Wignored-attributes. I agree it's not ideal, but I see no alternative, and I'm not sure there are many cases where a legitimately ignored attribute would be a problem (leaving as a potential issue only cases where the compiler wrongly ignores one). Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel