diff options
author | Andrew Jones <drjones@redhat.com> | 2020-03-10 12:15:55 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-03-16 19:59:04 +0300 |
commit | d9eaf19ecc12668caf280f3d8e24b22ff5ba716b (patch) | |
tree | 81ade0f88a194ae3e7e8a82e2482eaaf9451441b /tools/testing/selftests/kvm/include | |
parent | 6a46fcf92f063224cb29285287f99b93be8209d4 (diff) | |
download | linux-d9eaf19ecc12668caf280f3d8e24b22ff5ba716b.tar.xz |
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')
-rw-r--r-- | tools/testing/selftests/kvm/include/test_util.h | 3 |
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__) |