Re: [kvm-unit-tests PATCH 2/6] libcflat: add format checking to report()

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

 



On 17.05.2017 22:14, Radim Krčmář wrote:
> report() is a wrapper for printf(), but the compiler was not aware.
> 
> Signed-off-by: Radim Krčmář <rkrcmar@xxxxxxxxxx>
> ---
>  lib/libcflat.h | 18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/libcflat.h b/lib/libcflat.h
> index b1ea5e607033..a5c42903b11f 100644
> --- a/lib/libcflat.h
> +++ b/lib/libcflat.h
> @@ -96,14 +96,20 @@ extern int vsnprintf(char *buf, int size, const char *fmt, va_list va)
>  extern int vprintf(const char *fmt, va_list va)
>  					__attribute__((format(printf, 1, 0)));
>  
> -void report_prefix_pushf(const char *prefix_fmt, ...);
> +void report_prefix_pushf(const char *prefix_fmt, ...)
> +					__attribute__((format(printf, 1, 2)));
>  extern void report_prefix_push(const char *prefix);
>  extern void report_prefix_pop(void);
> -extern void report(const char *msg_fmt, bool pass, ...);
> -extern void report_xfail(const char *msg_fmt, bool xfail, bool pass, ...);
> -extern void report_abort(const char *msg_fmt, ...);
> -extern void report_skip(const char *msg_fmt, ...);
> -extern void report_info(const char *msg_fmt, ...);
> +extern void report(const char *msg_fmt, bool pass, ...)
> +					__attribute__((format(printf, 1, 3)));
> +extern void report_xfail(const char *msg_fmt, bool xfail, bool pass, ...)
> +					__attribute__((format(printf, 1, 4)));
> +extern void report_abort(const char *msg_fmt, ...)
> +					__attribute__((format(printf, 1, 2)));
> +extern void report_skip(const char *msg_fmt, ...)
> +					__attribute__((format(printf, 1, 2)));
> +extern void report_info(const char *msg_fmt, ...)
> +					__attribute__((format(printf, 1, 2)));
>  extern void report_pass(void);
>  extern int report_summary(void);

Reviewed-by: Thomas Huth <thuth@xxxxxxxxxx>




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux