]> git.ipfire.org Git - thirdparty/libvirt.git/commit
lib: Annotate more function as NULL terminated
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 5 Jun 2024 13:50:16 +0000 (15:50 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 6 Jun 2024 07:29:58 +0000 (09:29 +0200)
commit86e511fafbe0fadd063271b8d1b6f59c8b569e1b
tree86ef23bc969350868d1664b1236d1912cd59c7d3
parent9d0c8618db599c407d47a8a6af881708608cdcd9
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>
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c
tests/qemumigrationcookiexmltest.c
tests/testutils.h
tests/testutilsqemuschema.h
tools/vsh.c