From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 0589644E046 for ; Fri, 22 May 2026 14:40:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460803; cv=none; b=L6qWzZyXGxZf4n08yRo9SrKKE7ejlTv4FNnXtLEnHuHrifKqgWVDFrf1FKH/gNONl1D9avJYvrc496thOJGWkum1vwgViLqu3k7uUcsTYOYXlOSCT7bPFcFPL7nadRRCW0gfBPpW6IX8yo/kO6PYcl304qwz/Kwv760U3f73/hc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460803; c=relaxed/simple; bh=AUO79N4OYwgqJstiKKNUEpiLCGLIDPpsQRDhXE73PWA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cbNZA7K4p2aQZAJcB8pcM4mAd2DJilLeXpxVeTA2qT+DTlm9nAVi8/nF1tztZHd7jTdu4JNAIOk81e+J0LqqGdfRCCYrj1TdnXMiaI0nzF/yryFrwpH6mMcDI3Ixc1o2NMjXr4fhrCV+1o5MARTFS1hAEmSp5dILq3mIfWw3yFo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=XRUCvHNs; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="XRUCvHNs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1779460798; bh=AUO79N4OYwgqJstiKKNUEpiLCGLIDPpsQRDhXE73PWA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XRUCvHNsB012TCmqnbiPn3HVr91awco0XbE8gjqy6Zd9x4Fosq/1uiGdmc9cqbmGB DJWyh1QeMIXKJ9a4ZbpzQu3yCyBkb/x6Cbn/2sNNXLJ0EA1pI/WRvEyMi3MIqD+bHx WLsuu4Ji4Z6XyQUNJVLkEDtTukyx+yPm/ljbqlxc= Date: Fri, 22 May 2026 16:39:58 +0200 From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: David Laight Cc: Willy Tarreau , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] selftests/nolibc: cast execve() argv string to character pointer Message-ID: <75da0d46-dabb-435f-b92a-3e2bf465b986@t-8ch.de> References: <20260521-nolibc-write-strings-v1-0-2debb3ad4142@weissschuh.net> <20260521-nolibc-write-strings-v1-2-2debb3ad4142@weissschuh.net> <20260521191558.6e62c6bc@pumpkin> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260521191558.6e62c6bc@pumpkin> On 2026-05-21 19:15:58+0100, David Laight wrote: > On Thu, 21 May 2026 18:29:30 +0200 > Thomas Weißschuh wrote: > > > The existing code would trigger a warning under -Wwrite-strings which is > > about to be enabled. execve() is specified as not modifying the argv > > array, but the exact semantics are not representable in the type system. > > I suspect you'll have to fix it again to avoid 'casting away const'. Where would this warning be coming from? Which compiler flags are needed? Afaik it is legal to cast away const. > Can you use something like (char[]){"/"} ? That looks good. However if this issue is real we will also have it in nolibc's errno.h. There I don't want to use this pattern, as it requires more memory. (...) Thomas