selftests: arm64: sve-ptrace.c:85:40: warning: data argument not used by format string [-Wformat-extra-args]
From: Naresh Kamboju
Date: Thu Apr 18 2024 - 08:32:28 EST
The Linux next building selftests with clang-17 and gcc-13 found these
build warnings.
Reported-by: Linux Kernel Functional Testing <lkft@xxxxxxxxxx>
Build log:
---------
PATH:
selftests/arm64/fp
The reported build warnings noticed on following test files.
* sve-ptrace.c
* za-ptrace.c
* zt-ptrace.c
clang-17 warnings:
-----
sve-ptrace.c:85:40: warning: data argument not used by format string
[-Wformat-extra-args]
85 | ksft_exit_fail_msg("PTRACE_TRACEME", strerror(errno));
| ~~~~~~~~~~~~~~~~ ^
sve-ptrace.c:88:40: warning: data argument not used by format string
[-Wformat-extra-args]
88 | ksft_exit_fail_msg("raise(SIGSTOP)", strerror(errno));
| ~~~~~~~~~~~~~~~~ ^
sve-ptrace.c:344:11: warning: format specifies type 'int' but the
argument has type 'size_t' (aka 'unsigned long') [-Wformat]
343 | ksft_test_result_fail("Error allocating %d
byte buffer for %s VL %u\n",
| ~~
| %zu
344 | data_size, type->name, vl);
| ^~~~~~~~~
and more
Gcc-13 warnings:
------
sve-ptrace.c: In function 'do_child':
sve-ptrace.c:85:36: warning: too many arguments for format [-Wformat-extra-args]
85 | ksft_exit_fail_msg("PTRACE_TRACEME", strerror(errno));
| ^~~~~~~~~~~~~~~~
sve-ptrace.c:88:36: warning: too many arguments for format [-Wformat-extra-args]
88 | ksft_exit_fail_msg("raise(SIGSTOP)", strerror(errno));
| ^~~~~~~~~~~~~~~~
sve-ptrace.c: In function 'ptrace_set_sve_get_sve_data':
sve-ptrace.c:343:58: warning: format '%d' expects argument of type
'int', but argument 2 has type 'size_t' {aka 'long unsigned int'}
[-Wformat=]
343 | ksft_test_result_fail("Error allocating %d
byte buffer for %s VL %u\n",
| ~^
| |
| int
| %ld
344 | data_size, type->name, vl);
| ~~~~~~~~~
| |
| size_t {aka long unsigned int}
and more
Steps to reproduce:
---
tuxmake --runtime podman --target-arch arm64 --toolchain clang-nightly \
--kconfig https://storage.tuxsuite.com/public/linaro/lkft/builds/2fDW3nAXzFH2GOEle3S3MVC53A9/config
\
LLVM=1 LLVM_IAS=1 debugkernel dtbs dtbs-legacy headers kernel
kselftest modules
tuxmake --runtime podman --target-arch arm64 --toolchain gcc-13 \
--kconfig https://storage.tuxsuite.com/public/linaro/lkft/builds/2fDW3wG8BqWxf0afUI5f4wkArPi/config
\
debugkernel dtbs dtbs-legacy headers kernel kselftest modules
Links:
- https://storage.tuxsuite.com/public/linaro/lkft/builds/2fDW3nAXzFH2GOEle3S3MVC53A9/
- https://storage.tuxsuite.com/public/linaro/lkft/builds/2fDW3wG8BqWxf0afUI5f4wkArPi/
--
Linaro LKFT
https://lkft.linaro.org