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

Steven Rostedt <[email protected]> Thu, 23 Jul 2026 10:33:36 -0400
Newsgroups gmane.linux.ports.ppc.embedded,gmane.linux.kernel.bpf,gmane.comp.emulators.kvm.devel,gmane.linux.acpi.devel,gmane.linux.ports.arm.kernel,gmane.linux.kernel.gpio,gmane.linux.kernel.mm,gmane.linux.kernel.perf.user,gmane.linux.power-management.general,gmane.linux.network,gmane.linux.drivers.platform.x86.devel,gmane.linux.kernel,gmane.linux.kernel.janitors
Message-ID <[email protected]>
On Thu, 23 Jul 2026 06:47:00 -0700
Andi Kleen <[email protected]> wrote:

> > The source code was transformed by using the Coccinelle software.  
> 
> gcc already does this transformation automatically.

Yep, I showed this in my talk[1] that looked at what printf("Hello World!")
does. Doing an objdump of:

#include <stdio.h>

int main(void) {
	printf("Hello World!\n");
	return 0;
}

has:

0000000000001139 <main>:
    1139:       55                      push   %rbp
    113a:       48 89 e5                mov    %rsp,%rbp
    113d:       48 8d 05 c0 0e 00 00    lea    0xec0(%rip),%rax        # 2004 <_IO_stdin_used+0x4>
    1144:       48 89 c7                mov    %rax,%rdi
    1147:       e8 e4 fe ff ff          call   1030 <puts@plt>  <<<--- puts and not printf
    114c:       b8 00 00 00 00          mov    $0x0,%eax
    1151:       5d                      pop    %rbp
    1152:       c3                      ret

-- Steve

[1] https://www.youtube.com/watch?v=JRyrhsx-L5Y