On 11/22/2016 04:06 AM, Markus Armbruster wrote:
Eric Blake <address@hidden> writes:
On 11/21/2016 02:36 PM, Eric Blake wrote:
The source of your problem is that your platform defines PRId64
as 'qd',
but the qemu JSON parser only recognizes lld (POSIX) or I64d
(mingw) for
parsing 64-bit numbers. We could enhance the JSON parser to
recognize
the non-standard qd in addition to the hack we already have for
mingw,
Yes...
but I'd argue that using qobject_from_jsonf() is already less-
than-useful.
In fact, we are down to only a handful of users of our modified
'jsonf'
format (that is, strings that mix JSON with % modifiers):
hw/pci/pcie_aer.c: build a 5-element QDict
monitor.c: build a 1-element QDict which contains a 2-element QDict
qapi/qmp-dispatch.c: build a 2-element QDict
qapi/qmp-event.c: Build a 2-element QDict
plus the testsuite (check-qjson.c).
How did you find them?
git grep qobject_from_jsonf
I forgot about qobject_from_jsonv(), which is a bit more pervasive in
the testsuite, but even there, I only found a few additional uses of %
(that time, found by adding an assert(!strchr(format, '%')), then
seeing
where it triggered during 'make check'). I should have the cleanup
series later today. Technically, avoiding PRId64 in qmp-event.c is
worth having in 2.8 (it's a bug fix for Mac OS); but the rest of the
series is 2.9 material. Note that at least one of the testsuite
conversions I'm making also used PRId64 - is the original poster even
running 'make check', as at least check-qga would be evidence of the
JSON parser failing to understand Mac's %qd.