qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] linux-user: Suppress address-of-packed-member w


From: Laurent Vivier
Subject: Re: [Qemu-devel] [PATCH] linux-user: Suppress address-of-packed-member warnings in __get/put_user_e
Date: Fri, 5 Oct 2018 02:28:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 04/10/2018 18:55, Laurent Vivier wrote:
> Le 28/09/2018 à 16:25, Peter Maydell a écrit :
>> 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.
>>
>> 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 <address@hidden>
>> ---
>>  linux-user/qemu.h | 57 +++++++++++++++++++++++++++++++----------------
>>  1 file changed, 38 insertions(+), 19 deletions(-)
>>
> 
> Applied to my linux-user branch.

I have the following error when building on Fedora 28 and gcc (GCC)
8.1.1 20180712 (Red Hat 8.1.1-5)

  CC      aarch64_be-linux-user/target/arm/arm-semi.o
.../target/arm/arm-semi.c: In function ‘do_arm_semihosting’:
.../target/arm/arm-semi.c:270:1: error: unknown option after ‘#pragma
GCC diagnostic’ kind [-Werror=pragmas]

Perhaps you should use a "#if defined(__clang__)" to apply your fix only
to clang?

Thanks,
Laurent



reply via email to

[Prev in Thread] Current Thread [Next in Thread]