From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 EA89C81AA8 for ; Mon, 1 Jun 2026 11:41:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780314087; cv=none; b=A7qx/6Heu+xyMfEbzJM8VwysZVgCnfqyjbS+MGalVmjSJdCzXRXc/SNvfGg21R71ykVJGcHkkjMakEF4idg1viUcek+5UU9XXzrofilzXJob7Kb87o1Az7kAczu/aaBnHG1SuvUKTPXGIKCs0ZYBZvQpqq97/Bm+E0VCjNYOuL0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780314087; c=relaxed/simple; bh=iJsGAGlPkg/B0pVWYlD6Q6JsWCUE97MILhVBvQfWdsA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=RXWq6dj9ZdUx3lvPBSC972qVQ9Uua0h6qP79L2UbNPKfH34Aes6PB4FSPXR+SWfKvM3iSoDlkrFypLSUrevKAK/krtlHp9eDihIPi8dTs9vbtKiWuXxOFd22XWdrUrQUoq12MIko0FC3XT7e4/I3s4iBny9shkhLGQWbsHeAoo0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ecq/BFgT; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ecq/BFgT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780314084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=scxpqRpLdSyWr45VtBx1wy6WYcoA5+jM+O0vD+vZxZU=; b=ecq/BFgT+LmaTEjyNBrcswrg9F2Jx/g/92EnxRMEzVOqtOb/O4FYE23Z9eFjDhlDk7XWc/ bNNUd3Lg6/3IOvIhAjfSnP0nP/J/f872d+OJLUaZRe3i8URvB+j90tfQp9VGYvVVvU2kEN NgvK2szqQIuNqZTAD3S9eLOQc342+AY= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-453-FJDNsdliNMuUyWl3td35fA-1; Mon, 01 Jun 2026 07:41:21 -0400 X-MC-Unique: FJDNsdliNMuUyWl3td35fA-1 X-Mimecast-MFC-AGG-ID: FJDNsdliNMuUyWl3td35fA_1780314080 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BC3DE1956062; Mon, 1 Jun 2026 11:41:20 +0000 (UTC) Received: from oldenburg3.str.redhat.com (unknown [10.44.49.199]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E4A5B30001A2; Mon, 1 Jun 2026 11:41:18 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella Netto Cc: Alejandro Colomar , libc-alpha@sourceware.org, linux-man@vger.kernel.org Subject: Re: non-standard const-preserving string APIs In-Reply-To: <0c1e8b52-68d3-4be4-84aa-8ab5bdfee29a@linaro.org> (Adhemerval Zanella Netto's message of "Mon, 18 May 2026 14:19:46 -0300") References: <0c1e8b52-68d3-4be4-84aa-8ab5bdfee29a@linaro.org> Date: Mon, 01 Jun 2026 13:41:16 +0200 Message-ID: <87h5nmo5cz.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-man@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 * Adhemerval Zanella Netto: > On 17/05/26 10:59, Alejandro Colomar wrote: >> Hi Adhemerval, >>=20 >> On 2026-05-17T09:22:41-0300, Adhemerval Zanella Netto wrote: >>> >>> >>> On 16/05/26 15:15, Alejandro Colomar wrote: >>>> Hi! >>>> >>>> I'm working on documenting the recent API change of strchr(3) et al. >>>> to adapt to C23. While doing that, I've realized that the related APIs >>>> that are not standardized by ISO C, such as memrchr(3), have not been >>>> changed consistently with their relatives. Has this been discussed? >>>> >>>> I think the inconsistency might be dangerous. Should we change the >>>> other string functions accordingly? >>> I think it is reasonable to support const-preserving to the GNU interfa= ces as >>> well. Are you preparing a patch? >>=20 >> Yup, I will. Thanks! > I will try to take a look, but I recall from previous weekly calls > that Florian has raised objection that this does not solve the > overflow issue (not without further extra changes). > I am not sure if he still keep his objection, nor if it is would a > blocker for this new api. I still think we should fix it. Maybe rename the =E2=80=9Cdone=E2=80=9D va= riable in the vfprintf internals to =E2=80=9Cssize_t=E2=80=9D, and then gradually fix the= compilation failures, investigating whether the change is correct in context. We need to add some early bailout in case INT_MAX is crossed for the non-aprintf case. Thanks, Florian