Re: [Qemu-devel] [PATCH v2 1/4] qmp-event: Avoid qobject_from_jsonf("%"PRId64)

2016-11-24 Thread Eric Blake
On 11/24/2016 05:00 AM, Markus Armbruster wrote: > Eric Blake writes: > >> +/* Put -1 to indicate failure of getting host time */ >> +obj = qobject_from_jsonf("{ 'seconds': %lld, 'microseconds': %lld }", >> + err < 0 ? -1LL : tv.tv_sec, >>

Re: [Qemu-devel] [PATCH v2 1/4] qmp-event: Avoid qobject_from_jsonf("%"PRId64)

2016-11-24 Thread Markus Armbruster
Eric Blake writes: > The qobject_from_jsonf() function implements a pseudo-printf > language for creating a QObject; however, it is hard-coded to > only parse a subset of formats understood by -Wformat, and is > not a straight synonym to bare printf(). In particular, any >

[Qemu-devel] [PATCH v2 1/4] qmp-event: Avoid qobject_from_jsonf("%"PRId64)

2016-11-23 Thread Eric Blake
The qobject_from_jsonf() function implements a pseudo-printf language for creating a QObject; however, it is hard-coded to only parse a subset of formats understood by -Wformat, and is not a straight synonym to bare printf(). In particular, any use of an int64_t integer works only if the system's