Skip to content

Commit

Permalink
qemu/int128: Re-shuffle Int128Alias members
Browse files Browse the repository at this point in the history
Clang 14, with --enable-tcg-interpreter errors with

include/qemu/int128.h:487:16: error: alignment of field 'i' (128 bits)
  does not match the alignment of the first field in transparent union;
  transparent_union attribute ignored [-Werror,-Wignored-attributes]
    __int128_t i;
               ^
include/qemu/int128.h:486:12: note: alignment of first field is 64 bits
    Int128 s;
           ^
1 error generated.

By placing the __uint128_t member first, this is avoided.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230501204625.277361-1-richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed May 2, 2023
1 parent 50bec8a commit 67055d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/qemu/int128.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,9 @@ static inline void bswap128s(Int128 *s)
*/
#ifdef CONFIG_INT128
typedef union {
Int128 s;
__int128_t i;
__uint128_t u;
__int128_t i;
Int128 s;
} Int128Alias __attribute__((transparent_union));
#else
typedef Int128 Int128Alias;
Expand Down

0 comments on commit 67055d0

Please sign in to comment.