[Libguestfs] [PATCH] daemon: Add sentinel attribute to commandf and commandrf

Matthew Booth mbooth at redhat.com
Fri Dec 14 14:01:08 UTC 2012


Causes a compiler warning to be emitted if you omit the trailing NULL argument.
---
 daemon/daemon.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/daemon/daemon.h b/daemon/daemon.h
index 8f932d2..df1ba3a 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -100,9 +100,9 @@ extern char **split_lines (char *str);
 #define COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN 2048
 
 extern int commandf (char **stdoutput, char **stderror, int flags,
-                     const char *name, ...);
+                     const char *name, ...) __attribute__((sentinel));
 extern int commandrf (char **stdoutput, char **stderror, int flags,
-                      const char *name, ...);
+                      const char *name, ...) __attribute__((sentinel));
 extern int commandvf (char **stdoutput, char **stderror, int flags,
                       char const *const *argv);
 extern int commandrvf (char **stdoutput, char **stderror, int flags,
-- 
1.7.11.7




More information about the Libguestfs mailing list