All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: kvm@vger.kernel.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Subject: [kvm-unit-tests PATCH 2/6] libcflat: add format checking to report()
Date: Wed, 17 May 2017 22:14:01 +0200	[thread overview]
Message-ID: <20170517201405.19867-3-rkrcmar@redhat.com> (raw)
In-Reply-To: <20170517201405.19867-1-rkrcmar@redhat.com>

report() is a wrapper for printf(), but the compiler was not aware.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
 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

  parent reply	other threads:[~2017-05-17 20:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17 20:13 [kvm-unit-tests PATCH 0/6] improve report/printf formatting Radim Krčmář
2017-05-17 20:14 ` [kvm-unit-tests PATCH 1/6] fix conversions in report()s Radim Krčmář
2017-05-18  2:34   ` Thomas Huth
2017-05-18  8:03   ` David Hildenbrand
2017-05-17 20:14 ` Radim Krčmář [this message]
2017-05-18  2:38   ` [kvm-unit-tests PATCH 2/6] libcflat: add format checking to report() Thomas Huth
2017-05-17 20:14 ` [kvm-unit-tests PATCH 3/6] libcflat: fix padding in printf Radim Krčmář
2017-05-17 20:14 ` [kvm-unit-tests PATCH 4/6] pci-edu: remove 0x before a decimal value Radim Krčmář
2017-05-18  2:39   ` Thomas Huth
2017-05-17 20:14 ` [kvm-unit-tests PATCH 5/6] libcflat: support # flag in printf Radim Krčmář
2017-05-17 20:14 ` [kvm-unit-tests PATCH 6/6] use %# instead of 0x% in all format strings Radim Krčmář
2017-05-18 16:04 ` [kvm-unit-tests PATCH 0/6] improve report/printf formatting Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170517201405.19867-3-rkrcmar@redhat.com \
    --to=rkrcmar@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.