[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



On Fri, Dec 14, 2012 at 02:01:08PM +0000, Matthew Booth wrote:
> 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,
> -- 

ACK.

Any other functions we have that need to be marked this way?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]