On Sun, 28 Mar 2021, Markus Elfring wrote:
> The Coccinelle software can search for header files in addition to source
> if the option “--include-headers” was specified.
> How can it be achieved that only header files will be searched by this tool
> for special source code analysis and transformation approaches?
Probably the simplest is to put the names of the header files in a file,
eg find . -name "*h" > header_list, and then give the arguement
--file-groups header_list to Coccinelle.
Another option is to use python in te semantic patch to detect the current
file and then abort if it doesn't end in .h. But that would be much
slower because the undesired files would still be parsed.
Cocci mailing list