Re: [PATCH kvm-unit-tests] build: enable -Werror

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

 



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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux