lib: Annotate more function as NULL terminated

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>
This commit is contained in:
Michal Privoznik
2024-06-05 15:50:16 +02:00
parent 9d0c8618db
commit 86e511fafb
6 changed files with 9 additions and 6 deletions

View File

@@ -2418,7 +2418,7 @@ vshCloseLogFile(vshControl *ctl)
}
#ifndef WIN32
static void
static void G_GNUC_NULL_TERMINATED
vshPrintRaw(vshControl *ctl, ...)
{
va_list ap;