From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Huth Subject: Re: [PATCH kvm-unit-tests] build: enable -Werror Date: Fri, 4 Mar 2016 10:00:04 +0100 Message-ID: <56D94E94.6080509@redhat.com> References: <1457042122-30727-1-git-send-email-pfeiner@google.com> <56D94BB9.3030705@redhat.com> <56D94C34.7010807@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Paolo Bonzini , Peter Feiner , kvm@vger.kernel.org, drjones@redhat.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46834 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753811AbcCDJAI (ORCPT ); Fri, 4 Mar 2016 04:00:08 -0500 In-Reply-To: <56D94C34.7010807@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 04.03.2016 09:49, Paolo Bonzini wrote: > > > On 04/03/2016 09:47, Thomas Huth wrote: >>>> asm volatile("mov %%dr7,%0" : "=r" (dr7)); >>>> debugctl = rdmsr(MSR_IA32_DEBUGCTLMSR); >>>> /* Commented out: KVM does not support DEBUGCTL so far */ >>>> + assert(debugctl == debugctl); >>>> report("Guest=host debug controls", dr7 == 0x402 /* && debugctl == 0x1 */); >> Now these assert()s are really ugly. Wouldn't it be better do comment >> out the "debugctl = rdmsr(MSR_IA32_DEBUGCTLMSR);" line instead? > > This also looks better than the asserts: > > (void)debugctl; > > Thomas, if you're okay with it I can do the change locally. I personally would rather prefer to put comments around "debugctl =", but your suggestion looks at least better to me than the solution with assert() ... (since assert() can also be #undef in normal C projects, so IMHO it should not be used for something that has influence on the behavior of the normal C code). Thomas