libqtest: Document calling conventions
We have two flavors of vararg usage in qtest: qtest_hmp() etc. work like sprintf(), and qtest_qmp() etc. work like qobject_from_jsonf(). Spell that out in the comments. Also add GCC_FMT_ATTR() to qtest_hmp() etc. so that the compiler can flag incorrect use. We have some cleanup work to do before we can do the same for qtest_qmp() etc. This would get us the same better-than-nothing checking we already have for qobject_from_jsonf(): common incorrect uses of supported conversion specifications will be flagged (e.g. passing a double for %d), but use of unsupported ones won't. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com> Reviewed-by: NMarkus Armbruster <armbru@redhat.com> [Rebased, comment wording tweaked, commit message rewritten] Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Message-Id: <20180806065344.7103-6-armbru@redhat.com>
Showing
想要评论请 注册 或 登录