Gcc toolchain generates the below warning in clone.c,
freestanding.h:44:9: warning: ‘tls’ may be used uninitialized in this function [-Wmaybe-uninitialized] 44 | __syscall(sys_no, __cap(arg1), __cap(arg2), __cap(arg3), __cap(arg4), __cap(arg5), __cap(arg6)) | ^~~~~~~~~ clone.c:392:15: note: ‘tls’ was declared here 392 | void *tls;
Fix the above warning by initializing the pointer.
Signed-off-by: Amit Daniel Kachhap amit.kachhap@arm.com --- tools/testing/selftests/arm64/morello/clone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/arm64/morello/clone.c b/tools/testing/selftests/arm64/morello/clone.c index 53e9fb236e55..ca06adbf0dd9 100644 --- a/tools/testing/selftests/arm64/morello/clone.c +++ b/tools/testing/selftests/arm64/morello/clone.c @@ -385,7 +385,7 @@ void run_clone3(struct clone3_fixture *data) siginfo_t wait_si; int result; pid_t pid; - void *tls; + void *tls = NULL;
args->pidfd = (uintcap_t)&pidfd; args->parent_tid = (uintcap_t)&parent_tid;