On 07/03/2019 10:34, Jan Beulich wrote: > While I've not observed this myself, gcc 9 (imo validly) reportedly may > complain > > trace.c: In function '__trace_hypercall': > trace.c:826:19: error: taking address of packed member of 'struct > <anonymous>' may result in an unaligned pointer value > [-Werror=address-of-packed-member] > 826 | uint32_t *a = d.args; > > and the fix is rather simple - remove the __packed attribute. Introduce > a BUILD_BUG_ON() as replacement, for the unlikely case that Xen might > get ported to an architecture where array alignment higher that that of > its elements.
I really don't think the BUILD_BUG_ON() is helpful. Such a theoretical architecture will almost certainly have a compiler that spots the misalignment, or will take a trap the first time xentrace is ever used. ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel