From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SpiZP-0001wM-PM for qemu-devel@nongnu.org; Fri, 13 Jul 2012 12:18:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SpiZK-00051b-Gi for qemu-devel@nongnu.org; Fri, 13 Jul 2012 12:18:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62969) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SpiZK-00050A-8H for qemu-devel@nongnu.org; Fri, 13 Jul 2012 12:18:14 -0400 Message-ID: <50004A41.1090506@redhat.com> Date: Fri, 13 Jul 2012 18:18:09 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1342103249-20888-2-git-send-email-kwolf@redhat.com> <1342193500-5708-1-git-send-email-kwolf@redhat.com> <5000479A.1060001@redhat.com> <50004914.9010109@redhat.com> In-Reply-To: <50004914.9010109@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/2] coroutine-ucontext: Help valgrind understand coroutines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Peter Maydell , qemu-devel@nongnu.org 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 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