On 9/8/22 09:07, Chenyi Qiang 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. Suggested-by: Daniel P. Berrangé<[email protected]> Signed-off-by: Chenyi Qiang<[email protected]> --- configure | 1 + 1 file changed, 1 insertion(+)
Reviewed-by: Richard Henderson <[email protected]> I'm surprised this is on with -std=gnu11, as opposed to -std=c11. r~
