linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Marc Zyngier <maz@kernel.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Nathan Chancellor <nathan@kernel.org>,
	James Morse <james.morse@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Oliver Upton <oliver.upton@linux.dev>, Tom Rix <trix@redhat.com>,
	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 <ricarkol@google.com>,
	Aaron Lewis <aaronlewis@google.com>,
	Raghavendra Rao Ananta <rananta@google.com>
Subject: Re: [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
Date: Tue, 13 Dec 2022 02:13:25 +0000	[thread overview]
Message-ID: <Y5ffxebJ/eRzEXh+@google.com> (raw)
In-Reply-To: <CAKwvOdnRQQb9YbH=MgDymBmmjYgajc8tkyjbJVxjpA5zDZpNTQ@mail.gmail.com>

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

  reply	other threads:[~2022-12-13  2:14 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-13  0:16 [PATCH 00/14] KVM: selftests: Clang fixes, Makefile cleanup Sean Christopherson
2022-12-13  0:16 ` [PATCH 01/14] KVM: selftests: Define literal to asm constraint in aarch64 as unsigned long Sean Christopherson
2022-12-13  9:51   ` Philippe Mathieu-Daudé
2022-12-13  0:16 ` [PATCH 02/14] KVM: selftests: Delete dead code in x86_64/vmx_tsc_adjust_test.c Sean Christopherson
2022-12-13  0:16 ` [PATCH 03/14] KVM: selftests: Fix divide-by-zero bug in memslot_perf_test Sean Christopherson
2022-12-13  9:46   ` Philippe Mathieu-Daudé
2022-12-13  0:16 ` [PATCH 04/14] KVM: selftests: Use pattern matching in .gitignore Sean Christopherson
2022-12-13  0:16 ` [PATCH 05/14] KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width() Sean Christopherson
2022-12-13  9:47   ` Philippe Mathieu-Daudé
2022-12-13  0:16 ` [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86 Sean Christopherson
2022-12-13 20:03   ` Sean Christopherson
2022-12-14  9:43     ` Marc Zyngier
2022-12-24  9:12   ` Paolo Bonzini
2022-12-13  0:16 ` [PATCH 07/14] KVM: selftests: Use proper function prototypes in probing code Sean Christopherson
2022-12-13  9:48   ` Philippe Mathieu-Daudé
2022-12-13  0:16 ` [PATCH 08/14] KVM: selftests: Probe -no-pie with actual CFLAGS used to compile Sean Christopherson
2022-12-13  0:16 ` [PATCH 09/14] KVM: selftests: Explicitly disable builtins for mem*() overrides Sean Christopherson
2022-12-24  9:16   ` Paolo Bonzini
2022-12-13  0:16 ` [PATCH 10/14] KVM: selftests: Include lib.mk before consuming $(CC) Sean Christopherson
2022-12-24  9:18   ` Paolo Bonzini
2022-12-13  0:16 ` [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning Sean Christopherson
2022-12-13  1:36   ` Nick Desaulniers
2022-12-13  2:13     ` Sean Christopherson [this message]
2023-01-11 16:23       ` Paolo Bonzini
2022-12-13  0:16 ` [PATCH 12/14] KVM: selftests: Use wildcards to find library source files Sean Christopherson
2022-12-24  9:23   ` Paolo Bonzini
2023-01-04  1:09     ` Sean Christopherson
2022-12-13  0:16 ` [PATCH 13/14] KVM: selftests: Use wildcards to find targets and test " Sean Christopherson
2022-12-13  0:16 ` [PATCH 14/14] KVM: selftests: Enable RSEQ test for RISC-V Sean Christopherson

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=Y5ffxebJ/eRzEXh+@google.com \
    --to=seanjc@google.com \
    --cc=aaronlewis@google.com \
    --cc=alexandru.elisei@arm.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=james.morse@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=llvm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=oliver.upton@linux.dev \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=pbonzini@redhat.com \
    --cc=rananta@google.com \
    --cc=ricarkol@google.com \
    --cc=suzuki.poulose@arm.com \
    --cc=trix@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;
as well as URLs for NNTP newsgroup(s).