Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit cb708ab

Browse files
johnhubbardshuahkh
authored andcommitted
selftests/futex: pass _GNU_SOURCE without a value to the compiler
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>
1 parent e8b8c52 commit cb708ab

File tree

1 file changed

+1
-1
lines changed
  • tools/testing/selftests/futex/functional

1 file changed

+1
-1
lines changed

tools/testing/selftests/futex/functional/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
22
INCLUDES := -I../include -I../../ $(KHDR_INCLUDES)
3-
CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES) $(KHDR_INCLUDES)
3+
CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE= -pthread $(INCLUDES) $(KHDR_INCLUDES)
44
LDLIBS := -lpthread -lrt
55

66
LOCAL_HDRS := \

0 commit comments

Comments
 (0)