[CRIU] [PATCH] do_open_proc: annotate with printf attr

Andrei Vagin avagin at virtuozzo.com
Tue Feb 14 18:25:58 PST 2017


Applied. Thanks!
On Mon, Feb 13, 2017 at 02:52:32PM -0800, Kir Kolyshkin wrote:
> This will help us catch bugs where the arguments are not in line
> with the format string.
> 
> Signed-off-by: Kir Kolyshkin <kir at openvz.org>
> ---
>  criu/include/util.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/criu/include/util.h b/criu/include/util.h
> index d1332ae..392fa8c 100644
> --- a/criu/include/util.h
> +++ b/criu/include/util.h
> @@ -73,7 +73,8 @@ extern int set_proc_fd(int fd);
>  #define PROC_GEN	-1
>  #define PROC_NONE	-2
>  
> -extern int do_open_proc(pid_t pid, int flags, const char *fmt, ...);
> +extern int do_open_proc(pid_t pid, int flags, const char *fmt, ...)
> +	__attribute__ ((__format__ (__printf__, 3, 4)));
>  
>  #define __open_proc(pid, ier, flags, fmt, ...)				\
>  	({								\
> -- 
> 2.9.3
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list