Re: [PATCH v2] KVM: selftests: Compile code with warnings enabled

2019-05-23 Thread Andrew Jones
On Mon, May 20, 2019 at 12:03:08PM +0200, Paolo Bonzini wrote: > On 17/05/19 11:04, Thomas Huth wrote: > > So far the KVM selftests are compiled without any compiler warnings > > enabled. That's quite bad, since we miss a lot of possible bugs this > > way. Let's enable at least "-Wall" and some

Re: [PATCH v2] KVM: selftests: Compile code with warnings enabled

2019-05-20 Thread Paolo Bonzini
On 17/05/19 12:07, Thomas Huth wrote: > > lib/ucall.c: In function ‘get_ucall’: > lib/ucall.c:145:3: warning: dereferencing type-punned pointer will break > strict-aliasing rules [-Wstrict-aliasing] >gva = *(vm_vaddr_t *)run->mmio.data; > > x86_64/vmx_set_nested_state_test.c: In function >

Re: [PATCH v2] KVM: selftests: Compile code with warnings enabled

2019-05-20 Thread Paolo Bonzini
On 17/05/19 11:04, Thomas Huth wrote: > So far the KVM selftests are compiled without any compiler warnings > enabled. That's quite bad, since we miss a lot of possible bugs this > way. Let's enable at least "-Wall" and some other useful warning flags > now, and fix at least the trivial problems

Re: [PATCH v2] KVM: selftests: Compile code with warnings enabled

2019-05-17 Thread Vitaly Kuznetsov
Thomas Huth writes: > > x86_64/vmx_set_nested_state_test.c: In function > ‘set_revision_id_for_vmcs12’: > x86_64/vmx_set_nested_state_test.c:78:2: warning: dereferencing > type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] > *(u32 *)(state->data) = vmcs12_revision; > >

Re: [PATCH v2] KVM: selftests: Compile code with warnings enabled

2019-05-17 Thread Thomas Huth
On 17/05/2019 11.41, Vitaly Kuznetsov wrote: > Peter Xu writes: > >> On Fri, May 17, 2019 at 11:04:45AM +0200, Thomas Huth wrote: >>> So far the KVM selftests are compiled without any compiler warnings >>> enabled. That's quite bad, since we miss a lot of possible bugs this >>> way. Let's enable

Re: [PATCH v2] KVM: selftests: Compile code with warnings enabled

2019-05-17 Thread Vitaly Kuznetsov
Peter Xu writes: > On Fri, May 17, 2019 at 11:04:45AM +0200, Thomas Huth wrote: >> So far the KVM selftests are compiled without any compiler warnings >> enabled. That's quite bad, since we miss a lot of possible bugs this >> way. Let's enable at least "-Wall" and some other useful warning flags

Re: [PATCH v2] KVM: selftests: Compile code with warnings enabled

2019-05-17 Thread Peter Xu
On Fri, May 17, 2019 at 11:04:45AM +0200, Thomas Huth wrote: > So far the KVM selftests are compiled without any compiler warnings > enabled. That's quite bad, since we miss a lot of possible bugs this > way. Let's enable at least "-Wall" and some other useful warning flags > now, and fix at least

[PATCH v2] KVM: selftests: Compile code with warnings enabled

2019-05-17 Thread Thomas Huth
So far the KVM selftests are compiled without any compiler warnings enabled. That's quite bad, since we miss a lot of possible bugs this way. Let's enable at least "-Wall" and some other useful warning flags now, and fix at least the trivial problems in the code (like unused variables).