From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta1.formilux.org (mta1.formilux.org [51.159.59.229]) (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 CDD2B126F3B for ; Sun, 8 Feb 2026 16:06:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=51.159.59.229 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770566781; cv=none; b=YPt4ZR1kSQdZ9nhRg9v6Dm+GwtWbFVT+Q0BI/54l12VqlfK0/2d/0QsRLaMH8g/IKeaa+4uveANDt+85m/40YcMAziMgfISecMo5M6iMukohCv6XHnuGHb4xKCu7xjzG+uUorpJ2oiMAm8AfOVw3+n39J/fPdnY5sFFeljKFIAk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770566781; c=relaxed/simple; bh=s9XZ+pCAMW3E9DCCVIBQY3fBlX49RYPmkB/ac6F0pz8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QTYrRwy9AQ8DlpJTdLT7+zdDzwzeYu9qL4cUKDBXsHm/k8ex1ariPoWBjeaRmv9M/ji3/OENrfvbJ2gMhiP+T156WJIdCKtsPcvSwoDrkBJ2u688y1uwzqYiM59fZ5iaadCv/uClZu+0GlM5sG4v/Iah9t2jK24iwyPA4aalh24= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=1wt.eu; spf=pass smtp.mailfrom=1wt.eu; dkim=pass (1024-bit key) header.d=1wt.eu header.i=@1wt.eu header.b=VKwTtUuz; arc=none smtp.client-ip=51.159.59.229 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=1wt.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=1wt.eu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=1wt.eu header.i=@1wt.eu header.b="VKwTtUuz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1wt.eu; s=mail; t=1770566779; bh=Ldx4Elsv8jNrGPDinMxziHi8fihEU4yhPfinwE5e+BY=; h=From:Message-ID:From; b=VKwTtUuz8F075O/xbYNtZNANr/CML4lXGg6PDlUOKj5aLP6zSEITUA28maLd+woWh TfTg3iXmZLte1FWuIAHxwPYPMscw8H6YFO/PcfShP3L5cGPmbVpCn6AInh6QvoWU9C 8ozpq1XpKS29+mYPVGGHuV8udlo6ItEvZ5YLOtpI= Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by mta1.formilux.org (Postfix) with ESMTP id E17F1C09F9; Sun, 08 Feb 2026 17:06:18 +0100 (CET) Date: Sun, 8 Feb 2026 17:06:18 +0100 From: Willy Tarreau To: david.laight.linux@gmail.com Cc: Thomas =?iso-8859-1?Q?Wei=DFschuh?= , linux-kernel@vger.kernel.org, Cheng Li Subject: Re: [PATCH v2 next 07/11] tools/nolibc/printf: Add support for conversion flags "#- +" and format "%X" Message-ID: References: <20260206191121.3602-1-david.laight.linux@gmail.com> <20260206191121.3602-8-david.laight.linux@gmail.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20260206191121.3602-8-david.laight.linux@gmail.com> Another point I didn't notice, which confused me while reading next patch: On Fri, Feb 06, 2026 at 07:11:17PM +0000, david.laight.linux@gmail.com wrote: > + if (_NOLIBC_PF_FLAGS_CONTAIN(ch_flag, 'c', 'd', 'i', 'u', 'x', 'p', 's')) { > unsigned long long v; > long long signed_v; > - char *out = tmpbuf; > + char *out = tmpbuf + 32; > + int sign = 0; (...) > + if (_NOLIBC_PF_FLAGS_CONTAIN(ch_flag, 'p', '#' - 1)) { > + /* "%p" and "%#x" need "0x" prepending. */ > + sign = 'x' | '0' << 8; (...) > + /* Add 0, 1 or 2 ("0x") sign characters left of any zero padding */ > + for (; sign; sign >>= 8) { > + len++; > + *--out = sign; > + } That's fine, but please mention in front of "sign" declaration something like "/* may contain more than one char, starting with LSB */". Willy