From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [81.169.146.166]) (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 2E44C5B1FB for ; Thu, 18 Jul 2024 22:34:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=81.169.146.166 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721342086; cv=pass; b=MlV57/ZPBDoCfA43gmOVigOFxPqAW7vqDKq6N7s/Qx7ct9sj08h2Svr8YzOqKBNYTTgv77OJHnTJyq7Qv3fuR1bq380naSkM0gtMMO+D/NH9+Hy71GrLK44eLZ5PAJABsbnOcBd2tobyc0EvzklDgKGkDOaN+uHcxXi1rECWNrc= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721342086; c=relaxed/simple; bh=wuODuKlyvGXiRteE/intpYo4gGvTMT3l6f54FEs2nnM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Wc2sc5mbgZOmIOhToNm7ZMTRUOnwkSVt27KItVQQWdBU1JEFlAnEMB1jlh5qIt8SMTQ9HWMtY/9wWMzdt7V53Xh8JMMasSBcliHP5yJkB6PanzStjPQJVv0JuKfBwHw6imoBApI92A0k0qzqLaLlDCkv+xczkvZIkfPB87/GdV8= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=clisp.org; spf=none smtp.mailfrom=clisp.org; dkim=pass (2048-bit key) header.d=clisp.org header.i=@clisp.org header.b=DG4YzsIB; dkim=permerror (0-bit key) header.d=clisp.org header.i=@clisp.org header.b=KHCFrjKh; arc=pass smtp.client-ip=81.169.146.166 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=clisp.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=clisp.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=clisp.org header.i=@clisp.org header.b="DG4YzsIB"; dkim=permerror (0-bit key) header.d=clisp.org header.i=@clisp.org header.b="KHCFrjKh" ARC-Seal: i=1; a=rsa-sha256; t=1721342080; cv=none; d=strato.com; s=strato-dkim-0002; b=Eyl7PlScex+u2p1iMM/XdyP5Fvob47K+yyUKFYak6aMwsZEYhys7RBRRcTRQLFyRKH 9vUJk8v/8xqhkPZ8MjG5fRAPVo5k8YdSMygBGBfGM7DYuma217kcQgDnegkhFb90ZRgv rsT0/pHz4NUUpQGXXoTGMqmeE1CpQWx4xz8wr/icV6klnCf5QAdYNq6NBK8JTvYy2Twf TnGhUE2JVOIkjqyu5JqFuEXPUtM5qy0C71k6RttwVLQNQ5cJLfeSc4uN3RZobKYQY0CI HzIW5+aOTJrwmoZrGr6e6Sh+3OAtsL6W081W2rkfLNyH9CFhmrFTTG0M4IJpcodE+ITv Otwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1721342080; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=GgOywVk0z+9mnNVNST1C5xgAEnmE72h/503OTt6NGjU=; b=Z7Y31d+Q7pGE84Z5dUCOavoUy/ff53Mq0AMF8SZzTIQqyaiM0r5SsHylhv0OwRkiwu C0tOLhfwGQ3WQtNcjQ6gZWALtykprXJBj0t4gDF8cD5Dqx8ecKI9Ixt4Oqv0WiKzXQ0G ZOGoXTK2XjcQyUK2APB+J9sVQrmcU7q4aqxoFKMRypqc13YHMszNJIz61WgW8OfgMgFx EYfUk1K6Xt/+5IQoeHmOoxPx3UODn0iplG08DH3/oRf4Tg+3FunkcHqLcGks1Qa5iF3y XJTWa503DJOns7cY/2FSTlm5f63RlUzJcdm5etGHzB931NOFmc9riZUhobN45eOyhJoL tHCA== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo01 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1721342080; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=GgOywVk0z+9mnNVNST1C5xgAEnmE72h/503OTt6NGjU=; b=DG4YzsIBqF2Po4lhyUK3/+PEoojcUDAwxQ8IKlGrCbQVscDEdeZToLJiV3/XVCW4FH 9jcMMgrKosAcG1pxSVQHF7eJ19uvtwl/qHjmnaclRcGNs1ozq8yBr1LR6PZ5rUxn7ccv 4WaHjI066lefuxqywQiLw6dno1Z+ZQp1RpiXVcX2qBO0Ngji0WRwnSx7uL1RcEbp9+ts PgK3oPxhI28x5dbNGKLWYstPYaiU5RBMP25RAqGhfn1EfGvlWld6Z9DswTSLbygU3vL6 xzp0fcZId4eVxqPKtdH6gdrx/VOZNhiPmWfEWqdFuirWd9ZtlflYwcaM8oPTY2aBZyta Hfeg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1721342080; s=strato-dkim-0003; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=GgOywVk0z+9mnNVNST1C5xgAEnmE72h/503OTt6NGjU=; b=KHCFrjKhN4J3Y01rtthgzMV3YsMpGDoWRYOwuulgqCr5ZCCBRgjTSILgxKBo+KfupT ihFKPIPQm7SkEurRgIDQ== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpPCjqFxtlDfTi9pddt8LZVl8os5yg==" Received: from nimes.localnet by smtp.strato.de (RZmta 50.5.0 AUTH) with ESMTPSA id N0957e06IMYdDoU (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 19 Jul 2024 00:34:39 +0200 (CEST) From: Bruno Haible To: Alejandro Colomar , bug-gnulib@gnu.org, Michael Vetter Cc: Paul Eggert , =?utf-8?B?xJBvw6BuIFRy4bqnbiBDw7RuZw==?= Danh , Eli Schwartz , Sam James , Serge Hallyn , Iker Pedrosa , liba2i@lists.linux.dev Subject: Re: [PATCH v1] xstrtol: Remove dead code Date: Fri, 19 Jul 2024 00:34:39 +0200 Message-ID: <1937032.gKo4GoxMFQ@nimes> In-Reply-To: References: <20240718203147.47143-2-alx@kernel.org> <8009158.qOBuL9xsDt@nimes> Precedence: bulk X-Mailing-List: liba2i@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Alejandro Colomar wrote: > > - Some systems return "wrong" errno values. Example: [1] > > - Some systems fail with ENOMEM when memory is tight. Who says that > > an implementation of strtol() cannot use malloc() ? Some implementations > > of strtod() do use malloc(). > > > > So, what you call "dead code", I call "defensive programming". I would not > > like to apply this patch. > > Makes sense. I think we should document that possibility in the manual > page. Well, I wouldn't want to document just _theoretical_ platforms. The set of manual pages has a certain scope, regarding platform, probably Linux (and Hurd, maybe?). It's the behaviour on these platforms which should be documented, nothing more, nothing less. Defensive programming means to imagine other behaviours that could possibly occur. It is subjective; some programmers want to be more cautious than others. > Maybe say that other errno values are possible in some systems? Other errno values are always possible, as far as I understand POSIX. section 1.2 ERRORS. It would be overkill to state this in hundreds of manual pages, IMO. Bruno