diff options
author | Sean Christopherson <seanjc@google.com> | 2023-11-29 14:49:16 -0800 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2023-12-01 08:15:41 -0800 |
commit | 1b2658e4c709135fe1910423d3216632f641baf9 (patch) | |
tree | e7a2334f4a1cf840b1c3903fd3dfef2ce06076b4 /tools/testing/selftests/kvm/include/test_util.h | |
parent | f813e6d41baf2bbdd1624f9f01ac4f365eb78891 (diff) |
KVM: selftests: Annotate guest ucall, printf, and assert helpers with __printf()
Annotate guest printf helpers with __printf() so that the compiler will
warn about incorrect formatting at compile time (see git log for how easy
it is to screw up with the formatting).
Suggested-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20231129224916.532431-5-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include/test_util.h')
-rw-r--r-- | tools/testing/selftests/kvm/include/test_util.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h index a0c7dd3a5b30..71a41fa924b7 100644 --- a/tools/testing/selftests/kvm/include/test_util.h +++ b/tools/testing/selftests/kvm/include/test_util.h @@ -191,7 +191,7 @@ static inline uint32_t atoi_non_negative(const char *name, const char *num_str) } int guest_vsnprintf(char *buf, int n, const char *fmt, va_list args); -int guest_snprintf(char *buf, int n, const char *fmt, ...); +__printf(3, 4) int guest_snprintf(char *buf, int n, const char *fmt, ...); char *strdup_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2), nonnull(1))); |