1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/tools/testing/selftests/futex/functional
John Hubbard 4bf15b1c65 selftests/futex: don't pass a const char* to asprintf(3)
When building with clang, via:

    make LLVM=1 -C tools/testing/selftests

...clang issues this warning:

futex_requeue_pi.c:403:17: warning: passing 'const char **' to parameter
of type 'char **' discards qualifiers in nested pointer types
[-Wincompatible-pointer-types-discards-qualifiers]

This warning fires because test_name is passed into asprintf(3), which
then changes it.

Fix this by simply removing the const qualifier. This is a local
automatic variable in a very short function, so there is not much need
to use the compiler to enforce const-ness at this scope.

[1] https://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c49f@valentinobst.de/

Fixes: f17d8a87ec ("selftests: fuxex: Report a unique test name per run of futex_requeue_pi")
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2024-05-31 14:37:10 -06:00
..
.gitignore selftests: futex: Add sys_futex_waitv() test 2021-10-07 13:51:12 +02:00
futex_requeue.c selftests: futex: Add futex compare requeue test 2021-06-22 11:20:16 +02:00
futex_requeue_pi.c selftests/futex: don't pass a const char* to asprintf(3) 2024-05-31 14:37:10 -06:00
futex_requeue_pi_mismatched_ops.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
futex_requeue_pi_signal_restart.c selftests: futex: Fix 'the the' typo in comment 2022-08-02 21:57:03 +02:00
futex_wait.c selftests: futex: Add futex wait test 2021-06-22 11:20:15 +02:00
futex_wait_private_mapped_file.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
futex_wait_timeout.c selftests/futex: Order calls to futex_lock_pi 2023-08-16 10:48:10 -06:00
futex_wait_uninitialized_heap.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
futex_wait_wouldblock.c selftests: futex: Test sys_futex_waitv() wouldblock 2021-10-07 13:51:12 +02:00
futex_waitv.c selftests: futex: Add sys_futex_waitv() test 2021-10-07 13:51:12 +02:00
Makefile selftests/futex: pass _GNU_SOURCE without a value to the compiler 2024-05-30 13:10:51 -06:00
run.sh selftests: futex: Add sys_futex_waitv() test 2021-10-07 13:51:12 +02:00