From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [kvm-unit-tests PATCH 2/6] libcflat: add format checking to report() Date: Wed, 17 May 2017 22:14:01 +0200 Message-ID: <20170517201405.19867-3-rkrcmar@redhat.com> References: <20170517201405.19867-1-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Paolo Bonzini To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:55120 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754370AbdEQUPO (ORCPT ); Wed, 17 May 2017 16:15:14 -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 D54E280B52 for ; Wed, 17 May 2017 20:15:13 +0000 (UTC) In-Reply-To: <20170517201405.19867-1-rkrcmar@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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); -- 2.13.0