Re: [cocci] Improving output for single characters (with SmPL)?
Julia Lawall <[email protected]> Sat, 1 Aug 2026 10:18:39 +0200 (CEST)
| Newsgroups | fr.inria.cocci,org.kernel.vger.kernel-janitors,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Sat, 1 Aug 2026, Markus Elfring wrote: > >> 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? I don't know the details o what you are doing, but if you have duplicated output about herder files, it would be because the header file is included in other files. If there is no need to process the header file specifically based on a given .c file (which would be the case for the rul shown above), then you can use the option --no-includes. If you want some type information from header files but you don't want to transform them in a way that is specific to the .c file in which they are included then you can also use --include-headers-for-types. julia > > Regards, > Markus > >