All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>,
	G 3 <programmingkidx@gmail.com>,
	qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] qobject/qjson.c:69: failed assertion `obj != NULL'
Date: Tue, 22 Nov 2016 07:54:33 -0500 (EST)	[thread overview]
Message-ID: <442795206.1194764.1479819273263.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <fc46154c-5558-9606-2872-d4e294bcf38c@redhat.com>

> > 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.
> 
> What drives me most insane about them is that they are NOT the same
> escapes as printf(), so the compiler can't help us with type safety, and
> things like PRId64 don't always do what we want.  And except for %p for
> injecting nested objects, most of our escapes are just as easy to
> perform with g_strdup_printf() (injecting a string, integer, or
> boolean), or by manual creation of the QDict.

Oh wait.  Now I remember where we most used %-escapes and they're actually
much more useful and pervasive than you estimated.  See commit 563890c
("libqtest: escape strings in QMP commands, fix leak", 2014-07-01);
they cannot be produced with g_strdup_printf, because %s automatically
escapes strings.

The patch actually fixed a failure in qom-test, if I'm not mistaken, due
to a " appearing in a QOM path.

However, I'm still in favor of limiting % to the testsuite.

Paolo

  reply	other threads:[~2016-11-22 12:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-21  6:30 [Qemu-devel] qobject/qjson.c:69: failed assertion `obj != NULL' G 3
2016-11-21  9:13 ` Markus Armbruster
2016-11-21 10:02 ` Paolo Bonzini
2016-11-21 20:12   ` G 3
2016-11-21 20:36     ` Eric Blake
2016-11-21 20:46       ` Eric Blake
2016-11-21 20:53         ` G 3
2016-11-22  6:49           ` Paolo Bonzini
2016-11-22 10:06         ` Markus Armbruster
2016-11-22 12:41           ` Eric Blake
2016-11-22 12:54             ` Paolo Bonzini [this message]
2016-11-22 15:05               ` Markus Armbruster
2016-11-22 15:02             ` G 3
2016-11-22 15:13               ` Eric Blake
2016-11-22 16:00                 ` [Qemu-devel] check-qjson failure G 3
2016-11-22 22:42                   ` Eric Blake
2016-11-22 22:22       ` [Qemu-devel] qobject/qjson.c:69: failed assertion `obj != NULL' G 3
2016-11-22 22:41         ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=442795206.1194764.1479819273263.JavaMail.zimbra@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.