Re: [PATCH] tools: Use fputc() calls in some functions

Segher Boessenkool <[email protected]>
Newsgroups org.kernel.vger.linux-trace-kernel,dev.linux.lists.acpica-devel,dev.linux.lists.mptcp,dev.linux.lists.virtualization,org.kernel.vger.bpf,org.kernel.vger.kernel-janitors,org.kernel.vger.kvm,org.kernel.vger.linux-acpi,org.kernel.vger.linux-gpio,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest,org.kernel.vger.linux-perf-users,org.kernel.vger.linux-pm,org.kernel.vger.netdev,org.kernel.vger.platform-driver-x86,org.kvack.linux-mm,org.ozlabs.lists.linuxppc-dev
Message-ID <amIvxECTIM5paT94@gate>
On Thu, Jul 23, 2026 at 06:47:00AM -0700, Andi Kleen wrote:
> On Thu, Jul 23, 2026 at 12:25:25PM +0200, Markus Elfring wrote:
> > From: Markus Elfring <[email protected]>
> > Date: Thu, 23 Jul 2026 11:13:30 +0200
> > Subject: [PATCH] tools: Use fputc() calls in some functions
> > MIME-Version: 1.0
> > Content-Type: text/plain; charset=UTF-8
> > Content-Transfer-Encoding: 8bit
> > 
> > Single characters should occasionally be transferred into the output.
> > Thus use the corresponding function “fputc” (or even “putchar”).
> > 
> > The source code was transformed by using the Coccinelle software.
> 
> gcc already does this transformation automatically.

Yup.  And the printf() form is much more regular, expected, readable.
The primary consumers of source code are human beings, all programs
should be written with that in mind!


Segher
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.