libqtest: Document calling conventions
commitbb340eb2387edfc59098bde4caea387c369005b1
authorEric Blake <eblake@redhat.com>
Mon, 6 Aug 2018 06:53:26 +0000 (6 08:53 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 16 Aug 2018 06:42:06 +0000 (16 08:42 +0200)
tree3fdc044a05ef149ff29fbc4362bb47f34f240e8a
parent055a1efc7c5a30ca0993720da57ba70179d28c7b
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: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Rebased, comment wording tweaked, commit message rewritten]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180806065344.7103-6-armbru@redhat.com>
tests/libqtest.h