From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2D7CC4708E for ; Tue, 13 Dec 2022 02:13:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 16C7B4B935; Mon, 12 Dec 2022 21:13:34 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GqFafD1qjcjD; Mon, 12 Dec 2022 21:13:33 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 04DD54B87A; Mon, 12 Dec 2022 21:13:33 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 573C44B87A for ; Mon, 12 Dec 2022 21:13:31 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bzdvSr40qA5r for ; Mon, 12 Dec 2022 21:13:30 -0500 (EST) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id DBDAD4B877 for ; Mon, 12 Dec 2022 21:13:29 -0500 (EST) Received: by mail-pj1-f43.google.com with SMTP id fy4so1889919pjb.0 for ; Mon, 12 Dec 2022 18:13:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=dytxSctGH3/JU5+VUvCXKRl3djDPMXaOjikH1n5CrMU=; b=CBf3R1fmXIZ45yTb+WHxJdiyNOFL2h5rhe7iuVz+maaKt1rkPLuLZ1Vg6SAm23HMHG vQ6uXPH/ty7wkcdAYuV/Lh/0nTI9cyJfrD99XFzYtkzgINZ5bTa5LBeoIBAsqfn4QDC3 6SVFH94xQAmltYML5ctohPuMu25umC/aZZCO6gUijQK+8crcDBG5bvbVDVdxF3bugd0O rtoRLMRfttq4YtD01i5HrnVdRJstwarVuJG/T6s79sxcBeqvrkLe9Nt+5avTs3+UOplZ FkjJ/F9aFkiOlaZ3Av0iqu9jA/E5UOfBI4ocgDHSNbxKS74BDaooa/RlqBvBkybckhx2 eXVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dytxSctGH3/JU5+VUvCXKRl3djDPMXaOjikH1n5CrMU=; b=JiiNKAxdddraCjtxnG1Aor7ETwfSd5NygIkP3YMNUNmlbWT0nEvVyZdxh1ttGP7rsh a28/7gNoeQjvkQUsl/KnPtNsOY6HsUimc+oQOLecd3sJWw14QN4Qkeseg/ZPUZRj/38a uhVOqBep0XSGwZi9Fp5dWTu3kAF4y9aYzfHvlGViulrgKXd88gIKiCJIErRWWzdQoEor GsOBS5l4yeWxhZwKO5euvgJ87K1KVsLt8Ml7rD9CIkKOvOMuKRdqIIWF0PqAJk2EKPqm Eo9nHBJelIs3tXtzkawZ1P1UWCm5UcFYodUDU7RU2sVyMmHGjb6vVF6MGykiZZkHt3ZA duhQ== X-Gm-Message-State: ANoB5pkwF4FG7tLABjAjOLRqkASRq9/UiQ/4kJMoTCQJdwQjBwh7qNAo 7IA698MX0MQbN3L9aqzjR2tDtQ== X-Google-Smtp-Source: AA0mqf5lyAQrJvHm7xnE6hLi9O52SD019Oq6Ie+uJ0eyRDJIM2Xscc/SexS//WPdt/sgq2p4vlI/tg== X-Received: by 2002:a17:902:7b96:b0:189:858f:b5c0 with SMTP id w22-20020a1709027b9600b00189858fb5c0mr90604pll.0.1670897608745; Mon, 12 Dec 2022 18:13:28 -0800 (PST) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id d9-20020a170902654900b00176b63535adsm7060787pln.260.2022.12.12.18.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Dec 2022 18:13:28 -0800 (PST) Date: Tue, 13 Dec 2022 02:13:25 +0000 From: Sean Christopherson To: Nick Desaulniers Subject: Re: [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning Message-ID: References: <20221213001653.3852042-1-seanjc@google.com> <20221213001653.3852042-12-seanjc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Cc: Albert Ou , kvm@vger.kernel.org, Aaron Lewis , Marc Zyngier , llvm@lists.linux.dev, Tom Rix , linux-kernel@vger.kernel.org, Nathan Chancellor , Palmer Dabbelt , Paul Walmsley , kvmarm@lists.linux.dev, Paolo Bonzini , linux-riscv@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Mon, Dec 12, 2022, Nick Desaulniers wrote: > > diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile > > index 2487db21b177..9cff99a1cb2e 100644 > > --- a/tools/testing/selftests/kvm/Makefile > > +++ b/tools/testing/selftests/kvm/Makefile > > @@ -196,6 +196,7 @@ else > > LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include > > endif > > CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \ > > + -Wno-gnu-variable-sized-type-not-at-end \ > > This is a clang-specific warning. This will need to be wrapped in a > cc-option check. Not that I'm against guarding this code, but I don't think cc-option() will do anything in this case. AFAICT, gcc stopped treating unknown "-Wno" flags as unconditional errors starting with gcc-4.4, and the kernel's min supported version is 5.1. gcc-4.4 through gcc-9.5 all print a mild warning if there's a different error, but otherwise silently ignore the uknown "-Wno". cc1: warning: unrecognized command line option '-Wno-gnu-variable-sized-type-not-at-end' gcc-10.1 is even friendlier and notes that the unknown flag may have been related to the error. cc1: note: unrecognized command-line option '-Wno-gnu-variable-sized-type-not-at-end' may have been intended to silence earlier diagnostics Because cc-option() doesn't have errors in its probing code, it will return "true" on gcc for literally any "-Wno-*" input that gcc deems syntacially valid, e.g. gcc barfs on depends on $(cc-option,-Wno-) depends on $(cc-option,-Wno) but happily succeeds with depends on $(cc-option,-Wno-lol-gcc) Various man pages suggest -Wunknown-warnings is a thing, but no gcc version supported by godbolt recognizes it. So unless I'm missing something, trying to detect lack of support will be non-trivial, and the worst case scenario is that users of older gcc version will see a potentially confusing warning when the build fails. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A8A315C7 for ; Tue, 13 Dec 2022 02:13:29 +0000 (UTC) Received: by mail-pj1-f48.google.com with SMTP id v13-20020a17090a6b0d00b00219c3be9830so1992005pjj.4 for ; Mon, 12 Dec 2022 18:13:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=dytxSctGH3/JU5+VUvCXKRl3djDPMXaOjikH1n5CrMU=; b=CBf3R1fmXIZ45yTb+WHxJdiyNOFL2h5rhe7iuVz+maaKt1rkPLuLZ1Vg6SAm23HMHG vQ6uXPH/ty7wkcdAYuV/Lh/0nTI9cyJfrD99XFzYtkzgINZ5bTa5LBeoIBAsqfn4QDC3 6SVFH94xQAmltYML5ctohPuMu25umC/aZZCO6gUijQK+8crcDBG5bvbVDVdxF3bugd0O rtoRLMRfttq4YtD01i5HrnVdRJstwarVuJG/T6s79sxcBeqvrkLe9Nt+5avTs3+UOplZ FkjJ/F9aFkiOlaZ3Av0iqu9jA/E5UOfBI4ocgDHSNbxKS74BDaooa/RlqBvBkybckhx2 eXVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dytxSctGH3/JU5+VUvCXKRl3djDPMXaOjikH1n5CrMU=; b=YavzdPNvJrTwt1/p/XHMOaKufL5LHB3st0MChQDSs1KzHUnQGOZmi41K2+g3aoznKA hrTsexzKFoQo/jsNefH7Kw694bZpV6ARvDsnPx2L7wpGP3vZvwKLxBR3cNHiRsgeSkkQ XyaVDqLsbJ4ZDJpyD/XQbHLbuCePyPqJ33S50K5QxZwJI5VmraqyCBOJ+FaRN8sgjn9o 6sUCthrPEhnJTwdV0PYvqeP+Gy+7Z91Z0oO3EB7OK/EJB9VZPAzppp5C4TMXbznXKCxp /KihsImURZz5u0do0UDjbDf/rzwk4UFkQTmGQsSIG/hNGyvSRw17IOmgBF2DfzouEzeK qTXQ== X-Gm-Message-State: ANoB5pmR9zNsuWfAhY6QcD++r+1v5if4Ed5RGAgZR9i2DE4IH/D9F/ar 4WJHXKl4FLOyLCAhknWGkWaanQ== X-Google-Smtp-Source: AA0mqf5lyAQrJvHm7xnE6hLi9O52SD019Oq6Ie+uJ0eyRDJIM2Xscc/SexS//WPdt/sgq2p4vlI/tg== X-Received: by 2002:a17:902:7b96:b0:189:858f:b5c0 with SMTP id w22-20020a1709027b9600b00189858fb5c0mr90604pll.0.1670897608745; Mon, 12 Dec 2022 18:13:28 -0800 (PST) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id d9-20020a170902654900b00176b63535adsm7060787pln.260.2022.12.12.18.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Dec 2022 18:13:28 -0800 (PST) Date: Tue, 13 Dec 2022 02:13:25 +0000 From: Sean Christopherson To: Nick Desaulniers Cc: Paolo Bonzini , Marc Zyngier , Paul Walmsley , Palmer Dabbelt , Albert Ou , Nathan Chancellor , James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Tom Rix , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-riscv@lists.infradead.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Ricardo Koller , Aaron Lewis , Raghavendra Rao Ananta Subject: Re: [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning Message-ID: References: <20221213001653.3852042-1-seanjc@google.com> <20221213001653.3852042-12-seanjc@google.com> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Message-ID: <20221213021325.T7Tnk1VzcKZToo6uCp4FoosHupKlBDZWQIqGXYTX2aM@z> On Mon, Dec 12, 2022, Nick Desaulniers wrote: > > diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile > > index 2487db21b177..9cff99a1cb2e 100644 > > --- a/tools/testing/selftests/kvm/Makefile > > +++ b/tools/testing/selftests/kvm/Makefile > > @@ -196,6 +196,7 @@ else > > LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include > > endif > > CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \ > > + -Wno-gnu-variable-sized-type-not-at-end \ > > This is a clang-specific warning. This will need to be wrapped in a > cc-option check. Not that I'm against guarding this code, but I don't think cc-option() will do anything in this case. AFAICT, gcc stopped treating unknown "-Wno" flags as unconditional errors starting with gcc-4.4, and the kernel's min supported version is 5.1. gcc-4.4 through gcc-9.5 all print a mild warning if there's a different error, but otherwise silently ignore the uknown "-Wno". cc1: warning: unrecognized command line option '-Wno-gnu-variable-sized-type-not-at-end' gcc-10.1 is even friendlier and notes that the unknown flag may have been related to the error. cc1: note: unrecognized command-line option '-Wno-gnu-variable-sized-type-not-at-end' may have been intended to silence earlier diagnostics Because cc-option() doesn't have errors in its probing code, it will return "true" on gcc for literally any "-Wno-*" input that gcc deems syntacially valid, e.g. gcc barfs on depends on $(cc-option,-Wno-) depends on $(cc-option,-Wno) but happily succeeds with depends on $(cc-option,-Wno-lol-gcc) Various man pages suggest -Wunknown-warnings is a thing, but no gcc version supported by godbolt recognizes it. So unless I'm missing something, trying to detect lack of support will be non-trivial, and the worst case scenario is that users of older gcc version will see a potentially confusing warning when the build fails. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B60FFC4332F for ; Tue, 13 Dec 2022 02:13:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mAULPch7BFbqoNLBAJ2VLtPLoL1vNmXtBr/PtBRlllA=; b=dmTyPb4ctIQAem SBO3li42DgMeE1DmIE5n2tBEbfHJllNibJZhcjmbT9XLNn1h7+A3Y6ahg3Ty6hO+4VU6A6VtxCX35 d0Bm8pyDCDJ4nudwYuItw3QFo+v7+zvdKAHOJ8immuxFFdPM9nJxdC8LWNDUWaVMDg9tgeJD2CmU9 Cj455OGUpctHHS4MSSJqc8Mac2tz07pRFOS0o82ljxaPcWCQ/7stvJG6djYX5Rvh3qqT7yzM//QFt J/fp3gk8UiY8pDC5O/Tce0TyYsKz7DvaKh86eK0MuVBvTUynzj4BXCciJnQuIDQfhUrYc8p6A7E7w pOL8tkufKt+X2pIado1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p4une-009d3b-HE; Tue, 13 Dec 2022 02:13:42 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p4unV-009d1e-2l for linux-riscv@lists.infradead.org; Tue, 13 Dec 2022 02:13:34 +0000 Received: by mail-pj1-x1034.google.com with SMTP id u5so1821354pjy.5 for ; Mon, 12 Dec 2022 18:13:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=dytxSctGH3/JU5+VUvCXKRl3djDPMXaOjikH1n5CrMU=; b=CBf3R1fmXIZ45yTb+WHxJdiyNOFL2h5rhe7iuVz+maaKt1rkPLuLZ1Vg6SAm23HMHG vQ6uXPH/ty7wkcdAYuV/Lh/0nTI9cyJfrD99XFzYtkzgINZ5bTa5LBeoIBAsqfn4QDC3 6SVFH94xQAmltYML5ctohPuMu25umC/aZZCO6gUijQK+8crcDBG5bvbVDVdxF3bugd0O rtoRLMRfttq4YtD01i5HrnVdRJstwarVuJG/T6s79sxcBeqvrkLe9Nt+5avTs3+UOplZ FkjJ/F9aFkiOlaZ3Av0iqu9jA/E5UOfBI4ocgDHSNbxKS74BDaooa/RlqBvBkybckhx2 eXVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dytxSctGH3/JU5+VUvCXKRl3djDPMXaOjikH1n5CrMU=; b=M9T3vWSHtiKGUhfcUC3cfoP47A7SbIJRXd6tWP9bjs3y5JFCkg9Iemzl1h+iK4YIWB CysAPQz2fAYogIOSPDaJLJIq3QHj61Z6aU+kObgpVPGBGkwTpp6G2IDL6t/BSTGsm7RQ bWinUuviAIcKaXUDVf8O4spLrTHPgm2izCmX2kLrH3KB2MSGYiT9yzlbpLMvrTO6SpHO SdMto7DE5+nuyFsyShGgj0s3lzqb0wshAOjKyQTTKtjpakIK/vT579AUUI4p67B6ru1t bRqwGugOuIxvIIL590kp5YkYy5fj38/+J8grL7y1VoI9moUYpyfKcRMMt1r2XWOw4+Sy YFbA== X-Gm-Message-State: ANoB5pkzW33Kh6NcwG/zt9xzKurk6k74ezmyDT4vMgcjjxOIaE7WSJSZ xkLmdQJpUwBz7BNpYMrHyxQsBg== X-Google-Smtp-Source: AA0mqf5lyAQrJvHm7xnE6hLi9O52SD019Oq6Ie+uJ0eyRDJIM2Xscc/SexS//WPdt/sgq2p4vlI/tg== X-Received: by 2002:a17:902:7b96:b0:189:858f:b5c0 with SMTP id w22-20020a1709027b9600b00189858fb5c0mr90604pll.0.1670897608745; Mon, 12 Dec 2022 18:13:28 -0800 (PST) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id d9-20020a170902654900b00176b63535adsm7060787pln.260.2022.12.12.18.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Dec 2022 18:13:28 -0800 (PST) Date: Tue, 13 Dec 2022 02:13:25 +0000 From: Sean Christopherson To: Nick Desaulniers Cc: Paolo Bonzini , Marc Zyngier , Paul Walmsley , Palmer Dabbelt , Albert Ou , Nathan Chancellor , James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Tom Rix , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-riscv@lists.infradead.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Ricardo Koller , Aaron Lewis , Raghavendra Rao Ananta Subject: Re: [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning Message-ID: References: <20221213001653.3852042-1-seanjc@google.com> <20221213001653.3852042-12-seanjc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221212_181333_139413_62FC0597 X-CRM114-Status: GOOD ( 13.14 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Mon, Dec 12, 2022, Nick Desaulniers wrote: > > diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile > > index 2487db21b177..9cff99a1cb2e 100644 > > --- a/tools/testing/selftests/kvm/Makefile > > +++ b/tools/testing/selftests/kvm/Makefile > > @@ -196,6 +196,7 @@ else > > LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include > > endif > > CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \ > > + -Wno-gnu-variable-sized-type-not-at-end \ > > This is a clang-specific warning. This will need to be wrapped in a > cc-option check. Not that I'm against guarding this code, but I don't think cc-option() will do anything in this case. AFAICT, gcc stopped treating unknown "-Wno" flags as unconditional errors starting with gcc-4.4, and the kernel's min supported version is 5.1. gcc-4.4 through gcc-9.5 all print a mild warning if there's a different error, but otherwise silently ignore the uknown "-Wno". cc1: warning: unrecognized command line option '-Wno-gnu-variable-sized-type-not-at-end' gcc-10.1 is even friendlier and notes that the unknown flag may have been related to the error. cc1: note: unrecognized command-line option '-Wno-gnu-variable-sized-type-not-at-end' may have been intended to silence earlier diagnostics Because cc-option() doesn't have errors in its probing code, it will return "true" on gcc for literally any "-Wno-*" input that gcc deems syntacially valid, e.g. gcc barfs on depends on $(cc-option,-Wno-) depends on $(cc-option,-Wno) but happily succeeds with depends on $(cc-option,-Wno-lol-gcc) Various man pages suggest -Wunknown-warnings is a thing, but no gcc version supported by godbolt recognizes it. So unless I'm missing something, trying to detect lack of support will be non-trivial, and the worst case scenario is that users of older gcc version will see a potentially confusing warning when the build fails. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 44C5CC4332F for ; Tue, 13 Dec 2022 02:14:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6SPmKJsFTALI+sAkH+rA/MuehJFDP9xFVEGyomxXJYk=; b=bYKa0/cGmhyPQE IwJ4l3bq2CHDpAXisiBkAkekeFFASlGu7qZjVYFOfdFIWWCctgIdPWvfgi+7mjJglzduZNvf2p+je oxGYYJev+M+EsyrU7uODjaO45PhEzXS+6ZPTzYG0dbjDvPUv8kcXouIZJMUrTPjriq8S7/+C1UcdD bDPrad39705Jp64wLdketAZwvtn6wFjGkBimTNX7t0/4dkvovNlAO5aRiksc5+fVOe/HFAoF5EjXV O6kCclPGXQFn9wXW2E62bUXLHmS95A3ZXEty4i4wAeWY30dSmw8uXsY9c4tHc7ytZd4gv6vbNXZgp jZwo+r4bQQsBJuSJ2hsw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p4unW-009d2c-Sg; Tue, 13 Dec 2022 02:13:35 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p4unS-009d1f-3h for linux-arm-kernel@lists.infradead.org; Tue, 13 Dec 2022 02:13:32 +0000 Received: by mail-pl1-x636.google.com with SMTP id t2so11087122ply.2 for ; Mon, 12 Dec 2022 18:13:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=dytxSctGH3/JU5+VUvCXKRl3djDPMXaOjikH1n5CrMU=; b=CBf3R1fmXIZ45yTb+WHxJdiyNOFL2h5rhe7iuVz+maaKt1rkPLuLZ1Vg6SAm23HMHG vQ6uXPH/ty7wkcdAYuV/Lh/0nTI9cyJfrD99XFzYtkzgINZ5bTa5LBeoIBAsqfn4QDC3 6SVFH94xQAmltYML5ctohPuMu25umC/aZZCO6gUijQK+8crcDBG5bvbVDVdxF3bugd0O rtoRLMRfttq4YtD01i5HrnVdRJstwarVuJG/T6s79sxcBeqvrkLe9Nt+5avTs3+UOplZ FkjJ/F9aFkiOlaZ3Av0iqu9jA/E5UOfBI4ocgDHSNbxKS74BDaooa/RlqBvBkybckhx2 eXVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dytxSctGH3/JU5+VUvCXKRl3djDPMXaOjikH1n5CrMU=; b=jrI2rbcACWL3/abaHFjLiSW3WJOjaGQH8ydc1sau+y/Kygsd7N3avfIspoQkIYWEo1 BtQzeHwUPXiXGhWhM3Mby/+GRcSVB8cFYDe6qCQW5F7FFgSylpS90BHHOMxvWUhbPHse /eXcaRPskbPkRMHQRTwV/70S9KJLqwLGE5XAUXIL5NyVZ8ilXLRmvrqSlU2iZ0NJA3hB 3Vd+FwtZ5cO2RliJxZGenhKxDCKv456oDLRwCUe1vq4kWlC2K43ZmvvhqMcwxnnyRjAH nxSXXsCIheBburoCXxzowibG2DzU1V/R82ZH+4blnBTeQBAV2io4GodULZ4tH4A7yB8I 9Rrw== X-Gm-Message-State: ANoB5pkAjeLQYDRUY2RYQDGt8QfhTpBdGF04avbsIruFNdWPKl0oGqIB F4mNjFN05/psumY4S+g/jKqWWQ== X-Google-Smtp-Source: AA0mqf5lyAQrJvHm7xnE6hLi9O52SD019Oq6Ie+uJ0eyRDJIM2Xscc/SexS//WPdt/sgq2p4vlI/tg== X-Received: by 2002:a17:902:7b96:b0:189:858f:b5c0 with SMTP id w22-20020a1709027b9600b00189858fb5c0mr90604pll.0.1670897608745; Mon, 12 Dec 2022 18:13:28 -0800 (PST) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id d9-20020a170902654900b00176b63535adsm7060787pln.260.2022.12.12.18.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Dec 2022 18:13:28 -0800 (PST) Date: Tue, 13 Dec 2022 02:13:25 +0000 From: Sean Christopherson To: Nick Desaulniers Cc: Paolo Bonzini , Marc Zyngier , Paul Walmsley , Palmer Dabbelt , Albert Ou , Nathan Chancellor , James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Tom Rix , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-riscv@lists.infradead.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Ricardo Koller , Aaron Lewis , Raghavendra Rao Ananta Subject: Re: [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning Message-ID: References: <20221213001653.3852042-1-seanjc@google.com> <20221213001653.3852042-12-seanjc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221212_181330_194091_722D1914 X-CRM114-Status: GOOD ( 14.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Dec 12, 2022, Nick Desaulniers wrote: > > diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile > > index 2487db21b177..9cff99a1cb2e 100644 > > --- a/tools/testing/selftests/kvm/Makefile > > +++ b/tools/testing/selftests/kvm/Makefile > > @@ -196,6 +196,7 @@ else > > LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include > > endif > > CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \ > > + -Wno-gnu-variable-sized-type-not-at-end \ > > This is a clang-specific warning. This will need to be wrapped in a > cc-option check. Not that I'm against guarding this code, but I don't think cc-option() will do anything in this case. AFAICT, gcc stopped treating unknown "-Wno" flags as unconditional errors starting with gcc-4.4, and the kernel's min supported version is 5.1. gcc-4.4 through gcc-9.5 all print a mild warning if there's a different error, but otherwise silently ignore the uknown "-Wno". cc1: warning: unrecognized command line option '-Wno-gnu-variable-sized-type-not-at-end' gcc-10.1 is even friendlier and notes that the unknown flag may have been related to the error. cc1: note: unrecognized command-line option '-Wno-gnu-variable-sized-type-not-at-end' may have been intended to silence earlier diagnostics Because cc-option() doesn't have errors in its probing code, it will return "true" on gcc for literally any "-Wno-*" input that gcc deems syntacially valid, e.g. gcc barfs on depends on $(cc-option,-Wno-) depends on $(cc-option,-Wno) but happily succeeds with depends on $(cc-option,-Wno-lol-gcc) Various man pages suggest -Wunknown-warnings is a thing, but no gcc version supported by godbolt recognizes it. So unless I'm missing something, trying to detect lack of support will be non-trivial, and the worst case scenario is that users of older gcc version will see a potentially confusing warning when the build fails. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel