From: Mathieu Desnoyers Date: Mon, 13 Sep 2021 20:57:02 +0000 (-0400) Subject: Fix: powerpc32: transparent unions alter calling convention X-Git-Tag: v0.14.0~49 X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;h=087bce43020d2b45dab2dd8ecd6b0d6949c626f3;hp=087bce43020d2b45dab2dd8ecd6b0d6949c626f3;p=urcu.git Fix: powerpc32: transparent unions alter calling convention On powerpc32, transparent unions have an impact on the calling convention used for the argument, as they use the calling convention of the first field of the union rather than the union itself. On powerpc32, the calling convention for a union is that the register has a pointer to the union, which differs from the calling convention of its first field (which is a pointer in this case). "[...] the argument is passed to the function using the calling conventions of the first member of the transparent union, not the calling conventions of the union itself. All members of the union must have the same machine representation; this is necessary for this argument passing to work properly." [1] Therefore, use a transparent union for c++ so c++ compilers can emit caller code with a compatible stack layout. The "ignored attribute" warning emitted by clang appears to be only for architectures where the calling convention is not affected by the presence of transparent union attribute. Therefore, simply silence this warning. Link: https://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Type-Attributes.html [1] Signed-off-by: Mathieu Desnoyers Change-Id: I07182dd4ed37a3f61a226fb199bc98c95f83bd37 ---