Re: Improving output for single characters (with SmPL)?
From: Markus Elfring
Date: Sat Aug 01 2026 - 04:11:02 EST
>> Which implementation details should be reconsidered here for an affected macro?
>> https://elixir.bootlin.com/linux/v7.2-rc4/source/tools/bpf/bpftool/netlink_dumper.h#L25
>
> The shown source code transformation approach can be repeated on demand
> for selected areas.
I would like to add that only a single diff hunk is generated for the following script variant
of the semantic patch language (as it would usually be expected for the mentioned software component).
@replacement@
@@
-fprintf
+putchar
(
-stdout, "\n"
+'\n'
)
> Now I wonder about the following information.
>
> Markus_Elfring@Sonne:/home/altes_Heim2/elfring/Projekte/Linux/next-analyses> grep 'diff -u -p a/netlink_dumper.h b/netlink_dumper.h' /home/altes_Heim2/elfring/Projekte/Bau/Linux/scripts/Coccinelle/tuning1/next/20260721/use_fputc-bpftool-2.diff | wc -l
> 2
How can the generation of duplicate difference output be avoided here
for other SmPL script variations?
Regards,
Markus