From nobody Mon Feb 9 03:29:03 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1664214205; cv=none; d=zohomail.com; s=zohoarc; b=ncB1AHZrQKDcqEEjpBIDYftp+w1RLyGj4HwWkTKYDF9uBSm6MadVlPgLIUu+9uGGsRdZuyCHuOCKm93F5qmNLIoppZHS58niOwhwmIuK2NatshUrP4wIZkiaAhtoRsPL3Xe+JQFyia0/ngEHVHfrH0yX6g1tabpkzfoRUpWGIEo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664214205; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=drWi1DHiUWr7wK/Lif2h9vxTEvOepXqQd7lJiDXyv6s=; b=ZZ6NyKYCN2fIcKQP2+x5hPXArBi6BnyFPrgI4jU17Ty0R65CfQk6RPUr7HIYgZWUhRS3Uanc1j4PxBzE4RtoJoh5SHFo/3Sx6VhD4nHwSdcAhye+XTbTOXGasbHBD6LTUXXDl6fSTBfU4rNByN7/LoHfh0Ub9hE57rW7rBobukI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1664214205037836.2170156606792; Mon, 26 Sep 2022 10:43:25 -0700 (PDT) Received: from localhost ([::1]:50942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocs8Z-0001zf-3t for importer@patchew.org; Mon, 26 Sep 2022 13:43:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocrao-0005iX-7h for qemu-devel@nongnu.org; Mon, 26 Sep 2022 13:08:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:25202) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocraj-0005T9-RH for qemu-devel@nongnu.org; Mon, 26 Sep 2022 13:08:27 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-46-1Iuj7SsNMT6vhpTO7Ba-QA-1; Mon, 26 Sep 2022 13:08:21 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CDA9A185A794; Mon, 26 Sep 2022 17:08:20 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77083140EBF4; Mon, 26 Sep 2022 17:08:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664212104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=drWi1DHiUWr7wK/Lif2h9vxTEvOepXqQd7lJiDXyv6s=; b=U+Cb9Oh3auGMzKmgC5++hGpKhdrnhubJVpU5RfGy2uWtGt6SbRXrlunx4KyonQTGE90R6R i6Fpu8dWreIwk9b2lelkQIZcOyTugJUiDoH3Q33jgxtSFyxN/iloe1uBqKGEudogPF3DMP gf/kspkzvA7rdzDgnajqkJtkL2pkriY= X-MC-Unique: 1Iuj7SsNMT6vhpTO7Ba-QA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Chenyi Qiang , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Richard Henderson , Cornelia Huck Subject: [PULL 05/14] configure: Add -Wno-gnu-variable-sized-type-not-at-end Date: Mon, 26 Sep 2022 19:07:55 +0200 Message-Id: <20220926170804.453855-6-thuth@redhat.com> In-Reply-To: <20220926170804.453855-1-thuth@redhat.com> References: <20220926170804.453855-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664214207055100001 From: Chenyi Qiang A Linux headers update to v6.0-rc switches some definitions from GNU 'zero-length-array' extension to the C-standard-defined flexible array member. e.g. struct kvm_msrs { __u32 nmsrs; /* number of msrs in entries */ __u32 pad; - struct kvm_msr_entry entries[0]; + struct kvm_msr_entry entries[]; }; Those (unlike the GNU zero-length-array) have some extra restrictions like 'this must be put at the end of a struct', which clang build would complain about. e.g. the current code struct { struct kvm_msrs info; struct kvm_msr_entry entries[1]; } msr_data =3D { } generates the warning like: target/i386/kvm/kvm.c:2868:25: error: field 'info' with variable sized type 'struct kvm_msrs' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end] struct kvm_msrs info; ^ In fact, the variable length 'entries[]' field in 'info' is zero-sized in GNU defined semantics, which can give predictable offset for 'entries[1]' in local msr_data. The local defined struct is just there to force a stack allocation large enough for 1 kvm_msr_entry, a clever trick but requires to turn off this clang warning. Suggested-by: Daniel P. Berrang=C3=A9 Signed-off-by: Chenyi Qiang Reviewed-by: Richard Henderson Reviewed-by: Cornelia Huck Message-Id: <20220915091035.3897-2-chenyi.qiang@intel.com> Signed-off-by: Thomas Huth --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 0bbf9d28af..78e0ab8db4 100755 --- a/configure +++ b/configure @@ -1258,6 +1258,7 @@ add_to nowarn_flags -Wno-string-plus-int add_to nowarn_flags -Wno-typedef-redefinition add_to nowarn_flags -Wno-tautological-type-limit-compare add_to nowarn_flags -Wno-psabi +add_to nowarn_flags -Wno-gnu-variable-sized-type-not-at-end =20 gcc_flags=3D"$warn_flags $nowarn_flags" =20 --=20 2.31.1