From: Thomas Huth <thuth@redhat.com>
To: David Hildenbrand <david@redhat.com>,
kvm@vger.kernel.org, Drew Jones <drjones@redhat.com>,
Laurent Vivier <lvivier@redhat.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [kvm-unit-tests PATCH] s390x/intercept: Fix problem with bad compiler warning
Date: Tue, 27 Jun 2017 10:33:57 +0200 [thread overview]
Message-ID: <250f0a2e-0e0f-cdcf-e939-0fbd8a2ef5b2@redhat.com> (raw)
In-Reply-To: <ccf555b6-47fe-50fb-97aa-93fb7a8fd818@redhat.com>
On 27.06.2017 10:24, David Hildenbrand wrote:
> On 27.06.2017 06:18, Thomas Huth wrote:
>> The intercept test currently can not be compiled with GCC 4.8 anymore.
>> It generates the following warning (which is fatal due to -Werror):
>>
>> s390x/intercept.c: In function ‘test_stidp’:
>> s390x/intercept.c:111:9: error: missing initializer for field ‘version’ of ‘struct cpuid’ [-Werror=missing-field-initializers]
>> struct cpuid id = {};
>> ^
>> Fix it by using a "0" as intializer here.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>> NB: We could also remove the -Wextra from the CFLAGS instead. IMHO
>> using -Wextra together with -Werror is just like playing Russian roulette.
>> Since -Wextra is some kind of "compiler warning playground" for the GCC
>> folks, you never know which compiler version will trigger an unexpected
>> (and often also unfounded) warning here, so using this together with -Werror
>> is just a nuisance.
>
> I agree, this is really not deterministic.
>
>>
>> s390x/intercept.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/s390x/intercept.c b/s390x/intercept.c
>> index 9766289..9fe86cf 100644
>> --- a/s390x/intercept.c
>> +++ b/s390x/intercept.c
>> @@ -108,7 +108,7 @@ static void test_stap(void)
>> /* Test the STORE CPU ID instruction */
>> static void test_stidp(void)
>> {
>> - struct cpuid id = {};
>> + struct cpuid id = { 0 };
>>
>> asm volatile ("stidp %0\n" : "+Q"(id));
>> report("type set", id.type);
>>
>
> arm and powerpc also use -Wextra, maybe we should remove this then for all.
>
> Whatever you prefer.
True ... maybe Drew and Laurent can also comment on whether they like
-Wextra or not ... if we all agree, then we can remove it, otherwise
let's try to go with this patch first (in the hope that we won't hit the
next problem too soon).
> Reviewed-by: David Hildenbrand <david@redhat.com>
Thanks!
Thomas
next prev parent reply other threads:[~2017-06-27 8:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-27 4:18 [kvm-unit-tests PATCH] s390x/intercept: Fix problem with bad compiler warning Thomas Huth
2017-06-27 8:24 ` David Hildenbrand
2017-06-27 8:33 ` Thomas Huth [this message]
2017-06-27 8:53 ` Laurent Vivier
2017-06-27 9:03 ` Thomas Huth
2017-06-27 9:28 ` Laurent Vivier
2017-06-27 11:32 ` Andrew Jones
2017-06-27 12:09 ` Paolo Bonzini
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=250f0a2e-0e0f-cdcf-e939-0fbd8a2ef5b2@redhat.com \
--to=thuth@redhat.com \
--cc=david@redhat.com \
--cc=drjones@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox