[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 1/2] coroutine-ucontext: Help valgrind unders
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v2 1/2] coroutine-ucontext: Help valgrind understand coroutines |
Date: |
Fri, 13 Jul 2012 18:18:09 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 |
Am 13.07.2012 18:13, schrieb Eric Blake:
> On 07/13/2012 10:06 AM, Kevin Wolf wrote:
>> Am 13.07.2012 17:37, schrieb Peter Maydell:
>>> On 13 July 2012 16:31, Kevin Wolf <address@hidden> wrote:
>>>> +#ifdef CONFIG_VALGRIND_H
>>>> +/* Work around an unused variable in the valgrind.h macro... */
>>>> +#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
>>>> +static inline void valgrind_stack_deregister(CoroutineUContext *co)
>>>> +{
>>>> + VALGRIND_STACK_DEREGISTER(co->valgrind_stack_id);
>>>> +}
>>>> +#pragma GCC diagnostic error "-Wunused-but-set-variable"
>>>> +#endif
>>>
>>> '#pragma .. error' will defeat the configure code which makes warnings
>>> not fatal in release builds.
>>
>> I know. What's your suggestion? Switch only to warning? Then it would be
>> easy to miss warnings. Disabling the valgrind code for gcc < 4.6 is
>> better, but still not really nice.
>
> But you're already disabling the valgrind code for gcc too old to honor
>
> #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
>
> so what's the difference in making your configure check for
> CONFIG_VALGRIND_H _also_ check that gcc is new enough to honor push/pop
> of diagnostic?
The practical difference for me is that the RHEL 6 gcc knows
ignored/warning/error (since gcc 4.2), but not push/pop (since gcc 4.6),
so my test machine still wouldn't have valgrind support and I could drop
the patch wholesale.
Kevin
- [Qemu-devel] [PATCH 1/2] coroutine-ucontext: Help valgrind understand coroutines, (continued)
Re: [Qemu-devel] [PATCH 0/2] qemu-iotests: valgrind support, Paolo Bonzini, 2012/07/12