From nobody Mon Feb 9 10:28:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1662695604; cv=none; d=zohomail.com; s=zohoarc; b=byEvVIOp8FwFAfiq2Cel5UhhSjSTFy63y+eNRg5y7JnJMe8u+gcQ0XjbFIm0Uha2g0V+kzMCjReJ1qLLreX9/o1eU3l9priUs6KZwTKDzMgfDs8eYdySwDGilkLSgNcaCP0UveXmv0JjMdnTHK20zYP7pJIa5Bkva+9Q65U6Ia0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1662695604; 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=XQbkJu70okKM/mfF2i9H/SXf6S4pxxNXqRrtlfP48Tg=; b=Zx59yFfZ0L9fjlm37pMtxEQJiUoiQAdUr6JvKI5HXVYv3d3bs2xlTfaYmrFQg/1ftI/qkAXgGOVsexbV5v5eDZXo82nUqn5YIRcrNM9RR2wu10xjT9CFt8CtV04TjkN6PP/aqeieaWivMB45p7tPP/UvQcD3ZtrKSOswWrx3APk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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 1662695604477594.8227944144317; Thu, 8 Sep 2022 20:53:24 -0700 (PDT) Received: from localhost ([::1]:58648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWV50-0007NH-6J for importer@patchew.org; Thu, 08 Sep 2022 23:53:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWV3U-0005wv-B9 for qemu-devel@nongnu.org; Thu, 08 Sep 2022 23:51:48 -0400 Received: from mga04.intel.com ([192.55.52.120]:2107) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWV3S-0007cm-GE for qemu-devel@nongnu.org; Thu, 08 Sep 2022 23:51:47 -0400 Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 20:51:23 -0700 Received: from chenyi-pc.sh.intel.com ([10.239.159.73]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 20:51:21 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662695506; x=1694231506; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Lp5q79t7Y5EbMeOotyYgpUIpWHdm8wO46UP2JjcYawA=; b=POvkoav0Kn59V/kDdyuSFarJO+u3Vyu63qtYmXLJQTwgL7pm1tYF3FXE lP3ge8Rqpl72cps26fk/UGl+cT2hQ25QaE4qZjYa0kA4c28OTwKn9HOvs M+btCLFfKBpQOQ07Ew2rREklaC8MuAommPEW3a92nxOY5OjtkAF+L+90Z +UiR4eL6jRtFz9B5Pcitf46vtpf6IOBIMukpnwl2UdxRTukQp9whQ/qg1 6hs3dEQfAVyKMZMRHTmXUs6S8VY9w/FTwABB7AjcSIUf1qwO+7H1NVIMr iC+jK0fjri7f92ebs0TDXpgkXrgx0S41ZgAiFHosWFYhrruJOhYaMXtWH w==; X-IronPort-AV: E=McAfee;i="6500,9779,10464"; a="296125966" X-IronPort-AV: E=Sophos;i="5.93,302,1654585200"; d="scan'208";a="296125966" X-IronPort-AV: E=Sophos;i="5.93,302,1654585200"; d="scan'208";a="676991999" From: Chenyi Qiang To: "Michael S. Tsirkin" , Cornelia Huck , Paolo Bonzini , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Peter Maydell , Richard Henderson Cc: Chenyi Qiang , qemu-devel@nongnu.org Subject: [PATCH v2 1/2] configure: Add -Wno-gnu-variable-sized-type-not-at-end Date: Fri, 9 Sep 2022 11:57:57 +0800 Message-Id: <20220909035758.17434-2-chenyi.qiang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220909035758.17434-1-chenyi.qiang@intel.com> References: <20220909035758.17434-1-chenyi.qiang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=192.55.52.120; envelope-from=chenyi.qiang@intel.com; helo=mga04.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 @intel.com) X-ZM-MESSAGEID: 1662695606554100001 In recent linux headers update to v6.0-rc, it switched 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 Reviewed-by: Richard Henderson Signed-off-by: Chenyi Qiang Reviewed-by: Cornelia Huck --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 575dde1c1f..7e0a1a4187 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.17.1