All of lore.kernel.org
 help / color / mirror / Atom feed
From: vkuznets at redhat.com (Vitaly Kuznetsov)
Subject: [PATCH v2] KVM: selftests: Compile code with warnings enabled
Date: Fri, 17 May 2019 12:52:44 +0200	[thread overview]
Message-ID: <87zhnlpd37.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <1834df0f-b377-2231-0e5c-c5acd3298973@redhat.com>

Thomas Huth <thuth at redhat.com> 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;
>
> ... how do we want to handle such spots in the kvm selftest code?
> Compile with -fno-strict-aliasing? Or fix it with type-punning through
> unions?

These are tests, let's keep code simple. Casting my vote for the former
option)

-- 
Vitaly

WARNING: multiple messages have this Message-ID (diff)
From: vkuznets@redhat.com (Vitaly Kuznetsov)
Subject: [PATCH v2] KVM: selftests: Compile code with warnings enabled
Date: Fri, 17 May 2019 12:52:44 +0200	[thread overview]
Message-ID: <87zhnlpd37.fsf@vitty.brq.redhat.com> (raw)
Message-ID: <20190517105244.lIO3gZUyXDWJLM1IHCqN-1KnCw-1ac4P3mazGXwtW7M@z> (raw)
In-Reply-To: <1834df0f-b377-2231-0e5c-c5acd3298973@redhat.com>

Thomas Huth <thuth at redhat.com> 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;
>
> ... how do we want to handle such spots in the kvm selftest code?
> Compile with -fno-strict-aliasing? Or fix it with type-punning through
> unions?

These are tests, let's keep code simple. Casting my vote for the former
option)

-- 
Vitaly

WARNING: multiple messages have this Message-ID (diff)
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Thomas Huth <thuth@redhat.com>, Peter Xu <peterx@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	linux-kselftest@vger.kernel.org, kvm@vger.kernel.org,
	"Shuah Khan" <shuah@kernel.org>,
	"Andrew Jones" <drjones@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] KVM: selftests: Compile code with warnings enabled
Date: Fri, 17 May 2019 12:52:44 +0200	[thread overview]
Message-ID: <87zhnlpd37.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <1834df0f-b377-2231-0e5c-c5acd3298973@redhat.com>

Thomas Huth <thuth@redhat.com> 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;
>
> ... how do we want to handle such spots in the kvm selftest code?
> Compile with -fno-strict-aliasing? Or fix it with type-punning through
> unions?

These are tests, let's keep code simple. Casting my vote for the former
option)

-- 
Vitaly

  reply	other threads:[~2019-05-17 10:52 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17  9:04 [PATCH v2] KVM: selftests: Compile code with warnings enabled thuth
2019-05-17  9:04 ` Thomas Huth
2019-05-17  9:04 ` Thomas Huth
2019-05-17  9:30 ` peterx
2019-05-17  9:30   ` Peter Xu
2019-05-17  9:30   ` Peter Xu
2019-05-17  9:41   ` vkuznets
2019-05-17  9:41     ` Vitaly Kuznetsov
2019-05-17  9:41     ` Vitaly Kuznetsov
2019-05-17 10:07     ` thuth
2019-05-17 10:07       ` Thomas Huth
2019-05-17 10:07       ` Thomas Huth
2019-05-17 10:52       ` vkuznets [this message]
2019-05-17 10:52         ` Vitaly Kuznetsov
2019-05-17 10:52         ` Vitaly Kuznetsov
2019-05-20 10:00       ` pbonzini
2019-05-20 10:00         ` Paolo Bonzini
2019-05-20 10:00         ` Paolo Bonzini
2019-05-20 10:03 ` pbonzini
2019-05-20 10:03   ` Paolo Bonzini
2019-05-20 10:03   ` Paolo Bonzini
2019-05-23  9:11   ` drjones
2019-05-23  9:11     ` Andrew Jones
2019-05-23  9:11     ` Andrew Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zhnlpd37.fsf@vitty.brq.redhat.com \
    --to=unknown@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.