From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3FE381A8C3B; Tue, 18 Jun 2024 12:41:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718714465; cv=none; b=Qhz4qKQMJmv5n3S6pQvoxZ2/68KBIX2aUHIbLWtGbEaRfqyvfSBMC21YNaqxV5XS8DNQ2SwHL1khrySqF+PS48hoLxb9wRRnoYN44U3pvGflDZpPfqX69N9ByIVsOPCxH/pnmzL1iofpIeJ3XZEZw+9OU3k+drIe3ZFSgz/NVLo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718714465; c=relaxed/simple; bh=Ko6WKs9ylk0r3aUSIT4ZiJ7bdYWw11IOSysG9UUFjCI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Tyj+kviXSoTw2ybdPom0oM2kmy5QOMXyb4QGz449MWNQrZbUAgu5G/wGbSmtXC3DLIVxDPcJyfQ9KRjl47H8yF1+RIbd520TvEA2tHoYY9Lw0TBYS3/UhQspvG+ovJDDCH62Ck0WtuPhYsFj5RQLCYr23LvizshYOwKN06fcjNE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jJKXjwgQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jJKXjwgQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA1D5C3277B; Tue, 18 Jun 2024 12:41:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718714465; bh=Ko6WKs9ylk0r3aUSIT4ZiJ7bdYWw11IOSysG9UUFjCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jJKXjwgQJzp7HGlYMirdTBeb5imGixpRaotahEXUk0etHhWPmyY+igFz+n0KmTvBu ntTMoAVSM7duCCX27AvlNK+5zbtB+ewdtLUwbWPpRfMzOZaoac3fnih2Fc8ffhJTbQ eri7bo5ciBQ8bAiXQa5D0VZWpes882cn2hNzIRgQRaf4XFgzLN0OykjahAs+saKKF2 SQ+oHGhmAuPOG9ylBcHWA7RGd50LdEVjypq0K78yKEwXvuqqEkvIF/CH87BU4/c4RA W9BMWpJxCo8KfY1sThE1gne61k2KKzHx7MuXnf8YCzEWImJXKeh+iSwaBjbe7CF+rh 3fZ4Jwiecipwg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: John Hubbard , Edward Liaw , Davidlohr Bueso , Shuah Khan , Sasha Levin , tglx@linutronix.de, mingo@redhat.com, shuah@kernel.org, nathan@kernel.org, linux-kselftest@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH AUTOSEL 6.1 21/29] selftests/futex: pass _GNU_SOURCE without a value to the compiler Date: Tue, 18 Jun 2024 08:39:47 -0400 Message-ID: <20240618124018.3303162-21-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240618124018.3303162-1-sashal@kernel.org> References: <20240618124018.3303162-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.94 Content-Transfer-Encoding: 8bit From: John Hubbard [ Upstream commit cb708ab9f584f159798b60853edcf0c8b67ce295 ] 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 Reviewed-by: Davidlohr Bueso Signed-off-by: John Hubbard Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- tools/testing/selftests/futex/functional/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile index a392d0917b4e5..994fa3468f170 100644 --- a/tools/testing/selftests/futex/functional/Makefile +++ b/tools/testing/selftests/futex/functional/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 INCLUDES := -I../include -I../../ $(KHDR_INCLUDES) -CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES) $(KHDR_INCLUDES) +CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE= -pthread $(INCLUDES) $(KHDR_INCLUDES) LDLIBS := -lpthread -lrt LOCAL_HDRS := \ -- 2.43.0