[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240422170842.2073979-1-usama.anjum@collabora.com>
Date: Mon, 22 Apr 2024 22:08:42 +0500
From: Muhammad Usama Anjum <usama.anjum@...labora.com>
To: Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Shuah Khan <shuah@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>
Cc: Muhammad Usama Anjum <usama.anjum@...labora.com>,
kernel@...labora.com,
kvm@...r.kernel.org,
linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev
Subject: [PATCH] selftests: kvm: fix undeclared function error
Include kvm_test_harness.h first which will include kselftest_harness.h
for _GNU_SOURCE to get defined first before inclusion of stdio.h. It
is required for declaration of asprintf(). It removes the following
build error caught by clang-17:
In file included from x86_64/fix_hypercall_test.c:12:
In file included from include/kvm_test_harness.h:11:
./kselftest_harness.h:1169:2: error: call to undeclared function
'asprintf'; ISO C99 and later do not support implicit function declarations
[-Wimplicit-function-declaration]
1169 | asprintf(&test_name, "%s%s%s.%s", f->name,
| ^
Signed-off-by: Muhammad Usama Anjum <usama.anjum@...labora.com>
---
tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c b/tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c
index f3c2239228b10..75306dcfaad6c 100644
--- a/tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c
+++ b/tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c
@@ -4,12 +4,12 @@
*
* Tests for KVM paravirtual feature disablement
*/
+#include "kvm_test_harness.h"
#include <asm/kvm_para.h>
#include <linux/kvm_para.h>
#include <linux/stringify.h>
#include <stdint.h>
-#include "kvm_test_harness.h"
#include "apic.h"
#include "test_util.h"
#include "kvm_util.h"
--
2.39.2
Powered by blists - more mailing lists