]> git.proxmox.com Git - mirror_qemu.git/commit - linux-user/qemu.h
linux-user: Suppress address-of-packed-member warnings in __get/put_user_e
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 9 Oct 2018 16:18:14 +0000 (17:18 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Thu, 18 Oct 2018 18:17:49 +0000 (20:17 +0200)
commit850d5e330a9c68cc998cecc02caf8a3c8d1ee8a3
tree92af22f4d2c1c252ef160ebd83d0868a5a52a93d
parent77f7c747193662edfadeeb3118d63eed0eac51a6
linux-user: Suppress address-of-packed-member warnings in __get/put_user_e

Our __get_user_e() and __put_user_e() macros cause newer versions
of clang to generate false-positive -Waddress-of-packed-member
warnings if they are passed the address of a member of a packed
struct (see https://bugs.llvm.org/show_bug.cgi?id=39113).
Suppress these using the _Pragma() operator. Unfortunately
_Pragma() support in gcc is broken in some gcc versions and
in some usage contexts, so we limit the pragma usage here to clang.

To put in the pragmas we need to convert the macros from
expressions to statements, but all the callsites effectively
treat them as statements already so this is OK.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20181009161814.21257-1-peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/qemu.h