Eric Blake <ebl...@redhat.com> 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? >> It's hard to argue that the >> complexity of maintaining our pseudo-printf JSON parser for constructing >> a QObject with one line is worth the effort compared to the three or >> four lines to construct the same QObject by hand. > > I'm severely tempted to just rip out all of the poorly-underdocumented % > parsing from the JSON parser, as it will simplify our code, without much > pain in converting the four real users to just manually build up the > same objects. I kind of like the %-escapes, because they provide a compact and legible way to build QObjects. But with so little use, they're hardly earning their keep.