linux/tools/testing/selftests/futex/functional
John Hubbard c9edeb94d1 selftests/futex: pass _GNU_SOURCE without a value to the compiler
[ Upstream commit cb708ab9f5 ]

It's slightly better to set _GNU_SOURCE in the source code, but if one
must do it via the compiler invocation, then the best way to do so is
this:

    $(CC) -D_GNU_SOURCE=

...because otherwise, if this form is used:

    $(CC) -D_GNU_SOURCE

...then that leads the compiler to set a value, as if you had passed in:

    $(CC) -D_GNU_SOURCE=1

That, in turn, leads to warnings under both gcc and clang, like this:

    futex_requeue_pi.c:20: warning: "_GNU_SOURCE" redefined

Fix this by using the "-D_GNU_SOURCE=" form.

Reviewed-by: Edward Liaw <edliaw@google.com>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-07-25 09:50:43 +02: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 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07: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-07-25 09:50:43 +02:00
run.sh selftests: futex: Add sys_futex_waitv() test 2021-10-07 13:51:12 +02:00