[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] configure: Add -Wno-gnu-variable-sized-type-not-at-end
From: |
Peter Maydell |
Subject: |
Re: [PATCH 2/2] configure: Add -Wno-gnu-variable-sized-type-not-at-end |
Date: |
Thu, 8 Sep 2022 09:53:44 +0100 |
On Thu, 8 Sept 2022 at 09:08, Chenyi Qiang <chenyi.qiang@intel.com> wrote:
>
> After updating linux headers to v6.0-rc, clang build on x86 target would
> generate warnings like:
>
> target/i386/kvm/kvm.c:470: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;
> ^
> target/i386/kvm/kvm.c:1701:27: error: field 'cpuid' with variable sized
> type 'struct kvm_cpuid2' not at the end of a struct or class is a GNU
> extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
> struct kvm_cpuid2 cpuid;
> ^
> 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;
> ^
>
> Considering that it is OK to use GNU extension in QEMU (e.g. g_auto stuff),
> it is acceptable to turn off this warning, which is only relevant to people
> striving for fully portable C code.
Can we get the kernel folks to fix their headers not to
use GCC extensions like this ? It's not a big deal for us
I guess, but in general it doesn't seem great that the
kernel headers rely on userspace to silence warnings...
-- PMM
- [PATCH 0/2] Update linux headers to v6.0-rc4 and fix the clang build error, Chenyi Qiang, 2022/09/08
- [PATCH 2/2] configure: Add -Wno-gnu-variable-sized-type-not-at-end, Chenyi Qiang, 2022/09/08
- Re: [PATCH 2/2] configure: Add -Wno-gnu-variable-sized-type-not-at-end,
Peter Maydell <=
- Re: [PATCH 2/2] configure: Add -Wno-gnu-variable-sized-type-not-at-end, Cornelia Huck, 2022/09/08
- Re: [PATCH 2/2] configure: Add -Wno-gnu-variable-sized-type-not-at-end, Daniel P . Berrangé, 2022/09/08
- Re: [PATCH 2/2] configure: Add -Wno-gnu-variable-sized-type-not-at-end, Peter Maydell, 2022/09/08
- Re: [PATCH 2/2] configure: Add -Wno-gnu-variable-sized-type-not-at-end, Chenyi Qiang, 2022/09/08
- Re: [PATCH 2/2] configure: Add -Wno-gnu-variable-sized-type-not-at-end, Richard Henderson, 2022/09/08
- Re: [PATCH 2/2] configure: Add -Wno-gnu-variable-sized-type-not-at-end, Richard Henderson, 2022/09/08
- [PATCH 1/2] Update linux headers to v6.0-rc4, Chenyi Qiang, 2022/09/08