While __attribute((sentinel)) (exposed by glib under
G_GNUC_NULL_TERMINATED macro) is a gcc extension, it's supported
by clang too. It's already being used throughout our code but
some functions that take variadic arguments and expect NULL at
the end were lacking such annotation. Fill them in.
After this, there are still some functions left untouched because
they expect a different sentinel than NULL. Unfortunately, glib
does not provide macro for different sentinels. We may come up
with our own, but let's save that for future work.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
int qemuMonitorCreateObjectProps(virJSONValue **propsret,
const char *type,
const char *alias,
- ...);
+ ...)
+ G_GNUC_NULL_TERMINATED;
int qemuMonitorAddObject(qemuMonitor *mon,
virJSONValue **props,
*
* Returns 0 on success and -1 on error.
*/
-static int
+static int G_GNUC_NULL_TERMINATED
qemuMonitorJSONTransactionAdd(virJSONValue *actions,
const char *cmdname,
...)
static virBuffer testnamebuf = VIR_BUFFER_INITIALIZER;
-static const char *
+static const char * G_GNUC_NULL_TERMINATED
tn(const char *str, ...)
{
va_list ap;
int virTestMain(int argc,
char **argv,
int (*func)(void),
- ...);
+ ...)
+ G_GNUC_NULL_TERMINATED;
/* Setup, then call func() */
#define VIR_TEST_MAIN(func) \
int
testQEMUSchemaEntryMatchTemplate(virJSONValue *schemaentry,
- ...);
+ ...)
+ G_GNUC_NULL_TERMINATED;
virJSONValue *
}
#ifndef WIN32
-static void
+static void G_GNUC_NULL_TERMINATED
vshPrintRaw(vshControl *ctl, ...)
{
va_list ap;