From: Thomas Huth Subject: Re: [kvm-unit-tests PATCH 2/6] libcflat: add format checking to report() Date: Thu, 18 May 2017 04:38:01 +0200 Message-ID: <1e1ef235-b642-d508-7a68-daf53114f4ea@redhat.com> References: <20170517201405.19867-1-rkrcmar@redhat.com> <20170517201405.19867-3-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Paolo Bonzini To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:52266 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753638AbdERCiE (ORCPT ); Wed, 17 May 2017 22:38:04 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A25753DE3E for ; Thu, 18 May 2017 02:38:03 +0000 (UTC) In-Reply-To: <20170517201405.19867-3-rkrcmar@redhat.com> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: 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ář > --- > 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