On 26/09/2022 14.56, Peter Maydell wrote:
On Mon, 26 Sept 2022 at 13:53, Thomas Huth <th...@redhat.com> wrote:

On 02/09/2022 19.27, Matthew Rosato wrote:
Signed-off-by: Matthew Rosato <mjros...@linux.ibm.com>
---
...
diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h
index bf6e96011d..46de10a809 100644
--- a/linux-headers/asm-x86/kvm.h
+++ b/linux-headers/asm-x86/kvm.h
@@ -198,13 +198,13 @@ struct kvm_msrs {
       __u32 nmsrs; /* number of msrs in entries */
       __u32 pad;

-     struct kvm_msr_entry entries[0];
+     struct kvm_msr_entry entries[];
   };

Yuck, this fails to compile with Clang:

   https://gitlab.com/thuth/qemu/-/jobs/3084427423#L2206

   ../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;
                          ^

Anybody any ideas how to fix this best? Simply disable the compiler warning
in QEMU?

There's already a patchset on list that does that:
https://patchew.org/QEMU/20220915091035.3897-1-chenyi.qi...@intel.com/

Perfect, that's exactly what I need, thanks! I'll add those patches to my queue.

 Thomas


Reply via email to