accel: Silent few -Wmissing-field-initializers warning
cover accel: Silent few -Wmissing-field-initializers warning
Silent few -Wmissing-field-initializers warnings enabled by -Wextra.
Philippe Mathieu-Daudé (3):
tcg: Silent -Wmissing-field-initializers warning accel/kvm: Silent -Wmissing-field-initializers warning
softmmu: Silent -Wmissing-field-initializers warning
accel/kvm/kvm-all.c | 4 ++-- softmmu/vl.c | 2 +- tcg/tcg-common.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
2.38.1
PATCH 1/3 tcg: Silent -Wmissing-field-initializers warning
Silent when compiling with -Wextra:
tcg/i386/tcg-target.opc.h:34:1: warning: missing field 'args_ct' initializer [-Wmissing-field-initializers] DEF(x86_punpckl_vec, 1, 2, 0, IMPLVEC)
^
../tcg/tcg-common.c:30:66: note: expanded from macro 'DEF'
{ #s, oargs, iargs, cargs, iargs + oargs + cargs, flags },
^
--- tcg/tcg-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tcg/tcg-common.c +1 -1
@@ -27,7 +27,7 @@ TCGOpDef tcg_op_defs[] = { #define DEF(s, oargs, iargs, cargs, flags) \ - { #s, oargs, iargs, cargs, iargs + oargs + cargs, flags }, + { #s, oargs, iargs, cargs, iargs + oargs + cargs, flags, NULL },#include "tcg/tcg-opc.h" #undef DEF };
Signature · 1 line
2.38.1
Re: [PATCH 1/3] tcg: Silent -Wmissing-field-initializers warning
Quoted 9 lines · Philippe Mathieu-Daudé
Silent when compiling with -Wextra:
tcg/i386/tcg-target.opc.h:34:1: warning: missing field 'args_ct' initializer [-Wmissing-field-initializers]DEF(x86_punpckl_vec, 1, 2, 0, IMPLVEC)
^
../tcg/tcg-common.c:30:66: note: expanded from macro 'DEF'
{ #s, oargs, iargs, cargs, iargs + oargs + cargs, flags },
^
Quoted 4 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- tcg/tcg-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
PATCH 2/3 accel/kvm: Silent -Wmissing-field-initializers warning
In reply to Philippe Mathieu-DaudéSilent when compiling with -Wextra:
../accel/kvm/kvm-all.c:2291:17: warning: missing field 'num' initializer [-Wmissing-field-initializers]
{ NULL, }
^--- accel/kvm/kvm-all.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
accel/kvm/kvm-all.c +2 -2
@@ -2282,13 +2282,13 @@ static int kvm_init(MachineState *ms)static const char upgrade_note[] ="Please upgrade to at least kernel 2.6.29 or recent kvm-kmod\n" "(see http://sourceforge.net/projects/kvm).\n" ; -struct { +const struct {const char *name;int num; } num_cpus[] = { {"SMP" , ms->smp.cpus }, {"hotpluggable" , ms->smp.max_cpus }, - {NULL , } + {/* end of list */ } }, *nc = num_cpus;int soft_vcpus_limit, hard_vcpus_limit;KVMState *s;
Signature · 1 line
2.38.1
Re: [PATCH 2/3] accel/kvm: Silent -Wmissing-field-initializers warning
Quoted 10 lines · Philippe Mathieu-Daudé
Silent when compiling with -Wextra:
../accel/kvm/kvm-all.c:2291:17: warning: missing field 'num' initializer [-Wmissing-field-initializers]{ NULL, } ^Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- accel/kvm/kvm-all.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
PATCH 3/3 softmmu: Silent -Wmissing-field-initializers warning
In reply to Philippe Mathieu-DaudéSilent when compiling with -Wextra:
../softmmu/vl.c:886:12: warning: missing field 'flags' initializer [-Wmissing-field-initializers]
{ NULL },
^--- softmmu/vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
softmmu/vl.c +1 -1
@@ -883,7 +883,7 @@ static const QEMUOption qemu_options[] = {#define ARCHHEADING (text, arch_mask)#include "qemu-options.def" - { NULL }, + {/* end of list */ } }; typedef struct VGAInterfaceInfo {
Signature · 1 line
2.38.1
Re: [PATCH 3/3] softmmu: Silent -Wmissing-field-initializers warning
Quoted 10 lines · Philippe Mathieu-Daudé
Silent when compiling with -Wextra:
../softmmu/vl.c:886:12: warning: missing field 'flags' initializer [-Wmissing-field-initializers]{ NULL }, ^Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- softmmu/vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Quoted 11 lines · Philippe Mathieu-Daudé
Silent few -Wmissing-field-initializers warnings enabled by -Wextra.
Philippe Mathieu-Daudé (3):
tcg: Silent -Wmissing-field-initializers warning accel/kvm: Silent -Wmissing-field-initializers warning
softmmu: Silent -Wmissing-field-initializers warningaccel/kvm/kvm-all.c | 4 ++-- softmmu/vl.c | 2 +- tcg/tcg-common.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
If we're going to the trouble of fixing violations (which is good), then we shouuld also add -Wmissing-field-initializers (or -Wextra) to warn_flags in configure, to prevent regressions again in future.
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Quoted 13 lines · Daniel P. Berrangé
Quoted 11 lines · Philippe Mathieu-Daudé
Silent few -Wmissing-field-initializers warnings enabled by -Wextra.
Philippe Mathieu-Daudé (3):
tcg: Silent -Wmissing-field-initializers warning accel/kvm: Silent -Wmissing-field-initializers warning
softmmu: Silent -Wmissing-field-initializers warningaccel/kvm/kvm-all.c | 4 ++-- softmmu/vl.c | 2 +- tcg/tcg-common.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
Quoted 4 lines
If we're going to the trouble of fixing violations (which is good), then we shouuld also add -Wmissing-field-initializers (or -Wextra) to
warn_flagsin configure, to prevent regressions again in future.
Yes, I plan to add it at the end. I choose to split in small contained series to avoid spamming every maintainers, but this is actually that trivial that I could have sent as a big one...
Thanks for the review!