From patchwork Thu May 30 12:51:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13680366 Received: from fout6-smtp.messagingengine.com (fout6-smtp.messagingengine.com [103.168.172.149]) (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 D3C4D183987 for ; Thu, 30 May 2024 12:51:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717073479; cv=none; b=Zko+79u++7nzZifCMd1V5RaUM+nGcgQFpvIGz3I0A07xw2EXS/LGAhZBaAjc17xf9wBAWYc1Au3NoODx5R51wvtZaY0Q5mObZ/PAbcdP3cDcuMHJTlSL1p0np5oDxWKQ713bfUf/bPdSuu5+QX3QYS4E2xsy/qTuslXxA0QWx/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717073479; c=relaxed/simple; bh=7t5oD+MSVT8n9niTDZ1kPJvkw3qfChNWW7h8/6u9kM0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QLxnhLfmqhhyNpRifozYMoF8/FUxZQ/iDwSIfufkLfXs1oV8GhAi2FtyQYkaVvNTEbUBeWqgdCf3W369WkrVaX9GkSFa9HBB4Wy2Fyi6k4uqIjkpTJm++KPctV8liT41lar5ECE0WcbjWnpVZxPAVj0z0FkIHxhUWw1qDxWaJAU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=oGSuYdLw; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=qTo1MF3J; arc=none smtp.client-ip=103.168.172.149 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="oGSuYdLw"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="qTo1MF3J" Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id 1BABD13800E2; Thu, 30 May 2024 08:51:17 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 30 May 2024 08:51:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1717073477; x=1717159877; bh=TgPvfxbiR/ D4j4JUKVB89o3b29VaMuoR9B97KvbuOrY=; b=oGSuYdLwVAXP6d7clP1zT8PNVa 5Ev4OlxIgQVsyTeb8lo6dU8GmjQKDkTXi3XS7Km72qjoq5QHIuLO7txJlzOm5o1q N9moLkve9lSIq9a8AidLX5Ukm5jNq+GPl5BnlWurvqcKoe7JW4/zq7EBNoxCgdX1 qbugfOu5cZ6o7L3L/M5QJpCljL5kL3sVwrnMo91k+vsClRD+MqqdRgo/eHj+pOvs F4frZVQYgOEv4QeAa8muM49ixExKtB/xxF06cJb4oHf+DkZ2NZRGBQkVFiuCRifd c/a5A/DMjBhRSpNZidO79tZqaRFeKi1TNiE3puUYlhYsebzMMlm14Sm0mZ0A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1717073477; x=1717159877; bh=TgPvfxbiR/D4j4JUKVB89o3b29Va MuoR9B97KvbuOrY=; b=qTo1MF3J2bs9ojdlD1yrIGTPLm0mefEBd7T/DCEq9HP9 bOydhUQPtsTHPlROQWLOS/z1GH9GUMqLdtmDR4U0PgnrvduFGqpy3bSAUdjeOQqr hTlk0y0QlAwaZlNsQsM935UHAUy8X17fH145enREE/8mf4CH4nbf0bJsFYbHtsUx MZDpxBk+rr2Pmgum89xfPLc9dajYiO8UtR4y2ZZMCMbWNp2J6HWqK2qdj3mFn9ce igTrAHRSN+g3qwhnOk/xIMLv//dRg7MMuMzm+am0xXEobDKMXkAAbhUV63SJxc/5 ov8YiFR1dhE/XWnZ3LzcpiOeVkDTB0j9X30zCAII2A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdekgedgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfhfgggtuggjsehgtd erredttddvnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshes phhkshdrihhmqeenucggtffrrghtthgvrhhnpeeukedtvedtffevleejtefgheehieegke eluddvfeefgeehgfeltddtheejleffteenucevlhhushhtvghrufhiiigvpedvnecurfgr rhgrmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 May 2024 08:51:16 -0400 (EDT) Received: by localhost (OpenSMTPD) with ESMTPSA id a1cb30e9 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 May 2024 12:50:59 +0000 (UTC) Date: Thu, 30 May 2024 14:51:13 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano Subject: [PATCH v2 09/19] parse-options: cast long name for OPTION_ALIAS Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: We assign the long name for OPTION_ALIAS options to a non-constant value field. We know that the variable will never be written to, but this will cause warnings once we enable `-Wwrite-strings`. Cast away the constness to be prepared for this change. Signed-off-by: Patrick Steinhardt --- parse-options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse-options.h b/parse-options.h index bd62e20268..ae15342390 100644 --- a/parse-options.h +++ b/parse-options.h @@ -355,7 +355,7 @@ struct option { .type = OPTION_ALIAS, \ .short_name = (s), \ .long_name = (l), \ - .value = (source_long_name), \ + .value = (char *)(source_long_name), \ } #define OPT_SUBCOMMAND_F(l, v, fn, f) { \