* [Qemu-devel] qemu-0.11.50 build breaks at monitor.c
@ 2009-10-19 7:11 Kamalesh Babulal
0 siblings, 0 replies; 4+ messages in thread
From: Kamalesh Babulal @ 2009-10-19 7:11 UTC (permalink / raw)
To: mtosatti; +Cc: qemu-devel
Hi Marcelo,
qemu-0.11.50 build breaks with
CC 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 1
Changes to print_cpu_iter was introduced by
commit 00ee594280d46290629ccd5fcd1b5c1a21605e4c
Author: Marcelo Tosatti <mtosatti@redhat.com>
Date: Wed Oct 14 19:21:10 2009 -0300
Add missing thread_id field in "info cpus"
typecasting it int long, helps
monitor.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/monitor.c b/monitor.c
index b4c4878..5416fdb 100644
--- a/monitor.c
+++ b/monitor.c
@@ -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"));
monitor_printf(mon, "\n");
}
Kamalesh
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [Qemu-devel] qemu-0.11.50 build breaks at monitor.c
@ 2009-10-19 7:50 Laurent Vivier
2009-10-19 8:21 ` Kamalesh Babulal
0 siblings, 1 reply; 4+ messages in thread
From: Laurent Vivier @ 2009-10-19 7:50 UTC (permalink / raw)
To: kamalesh, mtosatti; +Cc: qemu-devel
>Hi Marcelo,
>
> qemu-0.11.50 build breaks with
>
>CC 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 1
>
>Changes to print_cpu_iter was introduced by
>
>commit 00ee594280d46290629ccd5fcd1b5c1a21605e4c
>Author: Marcelo Tosatti <mtosatti@redhat.com>
>Date: Wed Oct 14 19:21:10 2009 -0300
>
> Add missing thread_id field in "info cpus"
>
>typecasting it int long, helps
>
> monitor.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>diff --git a/monitor.c b/monitor.c
>index b4c4878..5416fdb 100644
>--- a/monitor.c
>+++ b/monitor.c
>@@ -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
--
--------------------- Laurent@vivier.eu ---------------------
"Tout ce qui est impossible reste à accomplir" Jules Verne
"Things are only impossible until they're not" Jean-Luc Picard
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] qemu-0.11.50 build breaks at monitor.c
2009-10-19 7:50 Laurent Vivier
@ 2009-10-19 8:21 ` Kamalesh Babulal
2009-10-19 18:30 ` Marcelo Tosatti
0 siblings, 1 reply; 4+ messages in thread
From: Kamalesh Babulal @ 2009-10-19 8:21 UTC (permalink / raw)
To: Laurent Vivier; +Cc: mtosatti, qemu-devel
* Laurent Vivier <Laurent@vivier.eu> [2009-10-19 09:50:21]:
> >Hi Marcelo,
> >
> > qemu-0.11.50 build breaks with
> >
> >CC 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 1
> >
> >Changes to print_cpu_iter was introduced by
> >
> >commit 00ee594280d46290629ccd5fcd1b5c1a21605e4c
> >Author: Marcelo Tosatti <mtosatti@redhat.com>
> >Date: Wed Oct 14 19:21:10 2009 -0300
> >
> > Add missing thread_id field in "info cpus"
> >
> >typecasting it int long, helps
> >
> > monitor.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> >diff --git a/monitor.c b/monitor.c
> >index b4c4878..5416fdb 100644
> >--- a/monitor.c
> >+++ b/monitor.c
> >@@ -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.
Hi Laurent,
Thanks for the review.
Resending the patch with changes recommended by Laurent.
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
--
monitor.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/monitor.c b/monitor.c
index b4c4878..bae2122 100644
--- a/monitor.c
+++ b/monitor.c
@@ -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");
}
>
> Regards,
> Laurent
Kamalesh
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] qemu-0.11.50 build breaks at monitor.c
2009-10-19 8:21 ` Kamalesh Babulal
@ 2009-10-19 18:30 ` Marcelo Tosatti
0 siblings, 0 replies; 4+ messages in thread
From: Marcelo Tosatti @ 2009-10-19 18:30 UTC (permalink / raw)
To: Kamalesh Babulal; +Cc: Laurent Vivier, qemu-devel
On Mon, Oct 19, 2009 at 01:51:02PM +0530, Kamalesh Babulal wrote:
> > >+ 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.
>
> Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-10-19 18:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-19 7:11 [Qemu-devel] qemu-0.11.50 build breaks at monitor.c Kamalesh Babulal
-- strict thread matches above, loose matches on Subject: below --
2009-10-19 7:50 Laurent Vivier
2009-10-19 8:21 ` Kamalesh Babulal
2009-10-19 18:30 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).