From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F264379ECF for ; Fri, 13 Mar 2026 22:40:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773441653; cv=none; b=l4XJ8IHw4wQkUmdB6Nuv/mVh7rIRVgswcCJOE6xUNscYRPYDrFArOmfWEYmoqIP9b0oRb1L12g+6sr3N+9kPo8C78sNb/crCQfmPWY7pVcB78byT2hW2Em0RvloziOXuA+5JaIn52PHJC+0qTZEvpCWO1edMf5Sifwgth6zBYh8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773441653; c=relaxed/simple; bh=d7MG383UP/UO7k3SUUI6+8CFBKaDF52oHeGOYOfBtLY=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Se6nnijINe0X7mJzbtO39Ka6TO3ex5Jp/5bI9hjqFZoMpkhcE6+39aITwaB3FNbtjIBbT3L1Ft+H/VcoGaBtWa2MUbzpK7hfBQl05CdIrn/nc/sdzM/I0VJWGi4lp9/+zndovfoVYxTngMX6v0UIp+5clTCN2VgUGOAvRDkA+WM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GAhghJug; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GAhghJug" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-439b7a87fb5so2049444f8f.3 for ; Fri, 13 Mar 2026 15:40:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773441650; x=1774046450; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=VIGGTlCzUTzasBYCcg7tqYoyLMTK4JKT7oe/T7MaGN8=; b=GAhghJugrWxTT51iLEASikCw4IAePOC7N7bl6rT4DBDPXmcOL43tNUaAmNLjyLBYUj lPYtnjU180whYSL0jr2UE85qpKHFSdmhilSZI/aONbK6zzMs5lLlcdl2SfgQnVG+PX0v qR7wKQsuKUsEaIapx7wyGNotNV6NNg4TSGPJqjul1A5u+3fz9CnUDoGxxj/mdWYc4YKe F3mk+O3vNsXH4DhI5cDjXcK5hGPySoSEMG6dSmCNypvj1LR5T+npZkzSc39RK8eFCEgv MVSIHzXJbe/OXx/Cs5wrNbLFD1JRmLt3usST7b+4XNBseGx0PIpw5Mf2HupPTcTivbq/ UuuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773441650; x=1774046450; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=VIGGTlCzUTzasBYCcg7tqYoyLMTK4JKT7oe/T7MaGN8=; b=ZAvqBDafrQ0nMW3mUFiOGQ7Mn8cnQz7+8g9p+WfYVhtu86geApzsRAQPVLt38srRdC /cKquPTvY/uEFWtA/f5zvZ/ZQX43WYk0IpoPMp1vcPG7aMtXIgKh98isiettKmjdB+4K fDClOwcjjy4PV4ceJ+4N88Iv4/C32JjTW0Svzba5T7is70P0yHc0NKI9J5dJuq+TZrr/ 1s52Kg2nhxe7gdOHqVLOnRnUxqaYTcVeJbI9n+K1wN2sAxtLl4cbQsSjLlN0lpalHtCq aXuCsfv/cJDcpsG3uxBLddslXMOHQTcQIKlME9EB87GSjlVI3E9C5ZAn2Ep2bJCTApQ6 G7lA== X-Forwarded-Encrypted: i=1; AJvYcCU5EyI0N1KSxeOJimMlxMXPUHGekNU3GWR+R5xiAH8ByApiq9jAeDXVGjsx51NsSPAlfRFtStzGDqaiMRU=@vger.kernel.org X-Gm-Message-State: AOJu0YzLyfp152NitpR9Cvc+jp+ryTPKBfZgQjuRIS6ztqg0WH9qcfd2 iQH/6oIMfuIH4rbX2B8KV3Qy4HE5OBOP8a6Ryt/Sm4JsHV8dFAbaA6Os X-Gm-Gg: ATEYQzx9018Hl9CCUSUXgT5ViD2oi8Nrl45qqyCEhaO1TxUYVO3oR1Yynur9QbfAjpZ KWq5Ox5Xb4/jRx+j0ezyl44Z0/cvqLIjHuif9zBEDUKP83+YH7qJTdMyGNfOlNVTU2oNWrK36R+ FlrXlZonpxgSUCn/lOY+mlX2mfNE+3eLnzn2d7HwMKycTShKJZNuTxlSNCaYA1/oe0bwDno96GD W6bbEdb+sTbb2cRQsYZa3okk1GfygSn16HoEjnQanjaAy7tsDmQhl7eKRUCXfRkk6dKA8vHKIAz 85RBruH4dFepJGAiT11WK6KPEy80pZjNIeCpdkeA8bfJ1aMijLr1o3gWaWxCeS49RrYT0dIebOd 4SBqcsJ8TvCxQk43+PsXfZT7VormUmKoFuvqpa8kWTVCIXNCi1CvYyqkeDBFDd0YNF3F+DG7V9y tR4huSwR3X31JhB1gdj3122CyPe4XeCono0w0o4Fwin+2Isp1f7Lh3wkrew1tpsr6u X-Received: by 2002:a05:6000:40c8:b0:439:abcd:b2fa with SMTP id ffacd0b85a97d-43a04da7c42mr9778079f8f.38.1773441650074; Fri, 13 Mar 2026 15:40:50 -0700 (PDT) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43a03cfd18fsm12322120f8f.36.2026.03.13.15.40.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 15:40:49 -0700 (PDT) Date: Fri, 13 Mar 2026 22:40:48 +0000 From: David Laight To: Thomas =?UTF-8?B?V2Vpw59zY2h1aA==?= Cc: Willy Tarreau , linux-kernel@vger.kernel.org, Cheng Li Subject: Re: [PATCH v5 next 00/17] Enhance printf() Message-ID: <20260313224048.630424ed@pumpkin> In-Reply-To: <2590eeb2-bf4e-4c10-9a72-d1ed9cd25f88@t-8ch.de> References: <20260308113742.12649-1-david.laight.linux@gmail.com> <20260308224121.56affbf7@pumpkin> <2590eeb2-bf4e-4c10-9a72-d1ed9cd25f88@t-8ch.de> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) 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-Transfer-Encoding: quoted-printable On Fri, 13 Mar 2026 21:07:28 +0100 Thomas Wei=C3=9Fschuh wrote: > Hi David, >=20 > On 2026-03-08 22:41:21+0000, David Laight wrote: > > On Sun, 8 Mar 2026 22:01:19 +0100 > > Thomas Wei=C3=9Fschuh wrote: =20 > > > On 2026-03-08 11:37:25+0000, david.laight.linux@gmail.com wrote: =20 > > > > From: David Laight > > > > David Laight (17): > > > > tools/nolibc: Add _NOLIBC_OPTIMIZER_HIDE_VAR() to compiler.h > > > > selftests/nolibc: Rename w to written in expect_vfprintf() > > > > tools/nolibc: Implement strerror() in terms of strerror_r() > > > > tools/nolibc: Rename the 'errnum' parameter to strerror() > > > > tools/nolibc/printf: Output pad characters in 16 byte chunks > > > > tools/nolibc/printf: Simplify __nolibc_printf() > > > > tools/nolibc/printf: Use goto and reduce indentation > > > > tools/nolibc/printf: Use bit-masks to hold requested flag, length= and > > > > conversion chars > > > > tools/nolibc/printf: Add support for length modifiers tzqL and fo= rmats > > > > iX > > > > tools/nolibc/printf: Handle "%s" with the numeric formats > > > > tools/nolibc/printf: Prepend sign to converted number > > > > tools/nolibc/printf: Add support for conversion flags space and p= lus > > > > tools/nolibc/printf: Special case 0 and add support for %#x > > > > tools/nolibc/printf: Add support for left aligning fields > > > > tools/nolibc/printf: Add support for zero padding and field preci= sion > > > > tools/nolibc/printf: Add support for octal output =20 > > >=20 > > > Beginning from here we have another sign-compare warning: > > >=20 > > > /home/t-8ch/.cache/crosstools/gcc-13.2.0-nolibc/i386-linux/bin/i386-l= inux-gcc -Os -fno-ident -fno-asynchronous-unwind-tables -std=3Dc89 -W -Wall= -Wextra -fno-stack-protector -Wmissing-prototypes -fstack-protector-all -= mstack-protector-guard=3Dglobal -fsanitize=3Dundefined -fsanitize-trap=3Dal= l -m32 -Werror -Wl,--fatal-warnings -o nolibc-test \ > > > -nostdlib -nostdinc -static -Isysroot/i386/include nolibc-test.c no= libc-test-linkage.c -lgcc > > > In file included from sysroot/i386/include/nolibc.h:123, > > > from sysroot/i386/include/stdio.h:8, > > > from nolibc-test.c:12: > > > sysroot/i386/include/stdio.h: In function '__nolibc_printf': > > > sysroot/i386/include/stdio.h:569:41: error: comparison of integer exp= ressions of different signedness: 'unsigned int' and 'char' [-Werror=3Dsign= -compare] > > > 569 | if (sign_prefix !=3D *out) { > > > | ^~ > > > cc1: all warnings being treated as errors > > >=20 > > > I have applied all of the patches *before* > > > "tools/nolibc/printf: Prepend sign to converted number", which > > > introduced the sign_prefix variable. > > >=20 > > > Could you fix this up and repost the remaining patches? =20 > >=20 > > I hate 'sign compare' ... > > I dislike using casts to 'fix' it - random 'integer' casts have caused = me > > grief in the past. > > I don't want to make 'sign_prefix' signed - stops you adding 4 characte= rs > > (should you so desire); not to mention >> being either UB or implementa= tion > > defined on signed values (or maybe just negative ones). =20 >=20 > Sorry for the long delay, I missed these mails. >=20 > >=20 > > The two obvious fixes are: > > if (sign_prefix - *out) =20 >=20 > I went with this and applied the rest of the series. > Thanks for all your patches! Thanks - I hadn't got around to resending them. David >=20 > > or: > > if (sign_prefix !=3D *out + 0u)=20 > >=20 > > Your pick :-) > >=20 > > At least it is only the last couple of patches. =20 >=20 >=20 > Thomas