From patchwork Tue Jun 27 04:18:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 9810775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CAF5560329 for ; Tue, 27 Jun 2017 04:18:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD59C28294 for ; Tue, 27 Jun 2017 04:18:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B18D92833C; Tue, 27 Jun 2017 04:18:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B1C828294 for ; Tue, 27 Jun 2017 04:18:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751261AbdF0ESW (ORCPT ); Tue, 27 Jun 2017 00:18:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36590 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750850AbdF0ESU (ORCPT ); Tue, 27 Jun 2017 00:18:20 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 331497EBD2 for ; Tue, 27 Jun 2017 04:18:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 331497EBD2 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=thuth@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 331497EBD2 Received: from thh440s.redhat.com (ovpn-116-48.ams2.redhat.com [10.36.116.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7BA237B8E6; Tue, 27 Jun 2017 04:18:16 +0000 (UTC) From: Thomas Huth To: David Hildenbrand , kvm@vger.kernel.org Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Drew Jones Subject: [kvm-unit-tests PATCH] s390x/intercept: Fix problem with bad compiler warning Date: Tue, 27 Jun 2017 06:18:15 +0200 Message-Id: <1498537095-627-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 27 Jun 2017 04:18:20 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: David Hildenbrand --- 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. 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);