qemu-0.11.50 build breaks at monitor.c
Quoted 29 lines
Hi Marcelo,
qemu-0.11.50 build breaks withCC
x86_64-softmmu/monitor.o
cc1: warnings being treated as errors /other/srcs/qemu-kvm/monitor.c: In function 'print_cpu_iter':
/other/srcs/qemu-kvm/monitor.c:450: error: format '%ld' expects type 'long int', but argument 3 has type 'int64_t'
make[3]: *** [monitor.o] Error 1Changes to
print_cpu_iterwas introduced bycommit
00ee594280d46290629ccd5fcd1b5c1a21605e4cAuthor: Marcelo Tosatti <[email protected]> Date: Wed Oct 14 19:21:10 2009 -0300Add missing
thread_idfield in "info cpus"typecasting it int long, helps
monitor.c| 2 +-1 files changed, 1 insertions(+), 1 deletions(-)monitor.c +0
-0
monitor.c static void print_cpu_iter(QObject *obj, void *opaque) · line 451
Quoted 6 lines
monitor.c +1
-1@@ -447,7 +447,7 @@ static void print_cpu_iter(QObject *obj, void *opaque)if (strcmp (qdict_get_str (cpu,"halted" ),"yes" ) ==0 )monitor_printf (mon," (halted)" ); -monitor_printf (mon," thread_id=%ld" ,qdict_get_int (cpu,"thread_id" )); +monitor_printf (mon," thread_id=%ld" , (int long )qdict_get_int (cpu,"thread_id" ));
You should use %PRId64 instead of %ld.
Regards,
Laurent
Signature · 3 lines
--------------------- [email protected] --------------------- "Tout ce qui est impossible reste à accomplir" Jules Verne "Things are only impossible until they're not" Jean-Luc Picard
Quoted 32 lines · Laurent Vivier
Quoted 32 lines
Hi Marcelo,
qemu-0.11.50 build breaks withCC
x86_64-softmmu/monitor.o
cc1: warnings being treated as errors /other/srcs/qemu-kvm/monitor.c: In function 'print_cpu_iter':
/other/srcs/qemu-kvm/monitor.c:450: error: format '%ld' expects type 'long int', but argument 3 has type 'int64_t'
make[3]: *** [monitor.o] Error 1Changes to
print_cpu_iterwas introduced bycommit
00ee594280d46290629ccd5fcd1b5c1a21605e4cAuthor: Marcelo Tosatti <[email protected]> Date: Wed Oct 14 19:21:10 2009 -0300Add missing
thread_idfield in "info cpus"typecasting it int long, helps
monitor.c| 2 +-1 files changed, 1 insertions(+), 1 deletions(-)monitor.c +0
-0@@ -447,7 +447,7 @@ static void print_cpu_iter(QObject *obj, void *opaque)if (strcmp (qdict_get_str (cpu,"halted" ),"yes" ) ==0 )monitor_printf (mon," (halted)" );
Quoted 5 lines
monitor.c static void print_cpu_iter(QObject *obj, void *opaque) · line 451
Quoted 3 lines
monitor.c +1
-1-monitor_printf (mon," thread_id=%ld" ,qdict_get_int (cpu,"thread_id" )); +monitor_printf (mon," thread_id=%ld" , (int long )qdict_get_int (cpu,"thread_id" ));You should use %PRId64 instead of %ld.
Hi Laurent,
Thanks for the review.
Resending the patch with changes recommended by Laurent.
--
monitor.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
monitor.c +2 -1
@@ -447,7 +447,8 @@ static void print_cpu_iter(QObject *obj, void *opaque)if (strcmp (qdict_get_str (cpu,"halted" ),"yes" ) ==0 )monitor_printf (mon," (halted)" ); -monitor_printf (mon," thread_id=%ld" ,qdict_get_int (cpu,"thread_id" )); +monitor_printf (mon," thread_id=%" PRId64" " , +qdict_get_int (cpu,"thread_id" ));monitor_printf (mon,"\n" ); }
Quoted 3 lines
Regards,
Laurent
Kamalesh
Marcelo Tosatti
AppliedQuoted 5 lines · Kamalesh Babulal
Quoted 4 lines
Quoted 2 lines
+ monitor_printf(mon, " thread_id=%ld", (int long)qdict_get_int(cpu,
"thread_id"));You should use %PRId64 instead of %ld.
Quoted 7 lines
Hi Laurent,
Thanks for the review.
Resending the patch with changes recommended by Laurent.
Signed-off-by Kamalesh Babulal <[email protected]>
Applied, thanks.