summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/include/test_util.h
diff options
context:
space:
mode:
authorAndrew Jones <drjones@redhat.com>2020-03-10 10:15:55 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2020-03-16 17:59:04 +0100
commitd9eaf19ecc12668caf280f3d8e24b22ff5ba716b (patch)
tree81ade0f88a194ae3e7e8a82e2482eaaf9451441b /tools/testing/selftests/kvm/include/test_util.h
parent6a46fcf92f063224cb29285287f99b93be8209d4 (diff)
downloadlinux-d9eaf19ecc12668caf280f3d8e24b22ff5ba716b.tar.bz2
KVM: selftests: Enable printf format warnings for TEST_ASSERT
Use the format attribute to enable printf format warnings, and then fix them all. Signed-off-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include/test_util.h')
-rw-r--r--tools/testing/selftests/kvm/include/test_util.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h
index c921ea719ae0..07823740227b 100644
--- a/tools/testing/selftests/kvm/include/test_util.h
+++ b/tools/testing/selftests/kvm/include/test_util.h
@@ -37,7 +37,8 @@ ssize_t test_read(int fd, void *buf, size_t count);
int test_seq_read(const char *path, char **bufp, size_t *sizep);
void test_assert(bool exp, const char *exp_str,
- const char *file, unsigned int line, const char *fmt, ...);
+ const char *file, unsigned int line, const char *fmt, ...)
+ __attribute__((format(printf, 5, 6)));
#define TEST_ASSERT(e, fmt, ...) \
test_assert((e), #e, __FILE__, __LINE__, fmt, ##__VA_ARGS__)