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 0A520185E65; Mon, 17 Jun 2024 13:25:43 +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=1718630743; cv=none; b=cP/UXzLW0WMQcCD2T2XvmqSvsRbMcPfJKPSA+/OFJaKc6ddVU/FqyMqurSy/NGXiJW0pDRC3CRhON8HAUNObE2MlxS1aWS88P3r/KB1yrI0ZQFNE0umhiplcTMEx583k6uJr6o4TuHY00lswO06rjOlEi8QI4VmQEuPaXdm1eZk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718630743; c=relaxed/simple; bh=Ko6WKs9ylk0r3aUSIT4ZiJ7bdYWw11IOSysG9UUFjCI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V6ObRkrcaQp5UlhAEuiuOuQ7182/XmfCpNyzjmzvIu7BFI8zXjqUXUhYnu083clbTj683X4nAiRmuNUlHUmwC3tdVn5q3QhG/385nC3Ov/1G97W3vqkhEtfld/2YVk5+ZCXMQX7AvpeRahLA6YlpItNuTnWi7PDiStkZ8+ZU0KE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TSpIim7d; 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="TSpIim7d" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BCA6C2BD10; Mon, 17 Jun 2024 13:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718630742; bh=Ko6WKs9ylk0r3aUSIT4ZiJ7bdYWw11IOSysG9UUFjCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TSpIim7dsv93hDokeF9di0UqPfApR7kyZnrl/NBplo+8/Tu4osxSNYI0yEp+bRUNE Au56EvCz1GhJcDIBmD1FGHazVOkCsL7+i4mtVEfUJhYAgGHIaTf4d/E3AFt6bZlnjv ioz7FLaGpk4HBJslSHxpgQlPKB/Wa2FiJrOMyCMQ1xpvSAmHMXSZ0WHp0BCEIyLfR2 4plm70R9y6S1cE2xLuZAJe7zKOVF0RfrRAWfbhwTNVUqiktCWL3RgquVcRug9N6oFp arSpEraY9YfqcX2OaSAPPfTdUEkJBnFeAcvpWmJRbHPCzVTgxnuv4+mT2UtX43b2jB N9N9seROu+Qdw== 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: Mon, 17 Jun 2024 09:24:25 -0400 Message-ID: <20240617132456.2588952-21-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240617132456.2588952-1-sashal@kernel.org> References: <20240617132456.2588952-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