cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* [Cocci] Searching only for header files with the Coccinelle software
@ 2021-03-28  6:15 Markus Elfring
  2021-03-28  9:27 ` Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2021-03-28  6:15 UTC (permalink / raw)
  To: Coccinelle

Hello,

The Coccinelle software can search for header files in addition to source files
if the option “--include-headers” was specified.
https://github.com/coccinelle/coccinelle/blob/287374196da8c7cfd169e721a2d23f1e462422f1/docs/manual/spatch_options.tex#L43

How can it be achieved that only header files will be searched by this tool
for special source code analysis and transformation approaches?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Cocci] Searching only for header files with the Coccinelle software
  2021-03-28  6:15 [Cocci] Searching only for header files with the Coccinelle software Markus Elfring
@ 2021-03-28  9:27 ` Julia Lawall
       [not found]   ` <30240b24-99e5-eafb-c167-777ca1a6ec59@web.de>
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2021-03-28  9:27 UTC (permalink / raw)
  To: Markus Elfring; +Cc: Coccinelle

[-- Attachment #1: Type: text/plain, Size: 852 bytes --]



On Sun, 28 Mar 2021, Markus Elfring wrote:

> Hello,
>
> The Coccinelle software can search for header files in addition to source files
> if the option “--include-headers” was specified.
> https://github.com/coccinelle/coccinelle/blob/287374196da8c7cfd169e721a2d23f1e462422f1/docs/manual/spatch_options.tex#L43
>
> 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.

julia

[-- Attachment #2: Type: text/plain, Size: 136 bytes --]

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Cocci] Searching only for header files with the Coccinelle software
       [not found]   ` <30240b24-99e5-eafb-c167-777ca1a6ec59@web.de>
@ 2021-03-28 10:48     ` Julia Lawall
  0 siblings, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2021-03-28 10:48 UTC (permalink / raw)
  To: Markus Elfring; +Cc: Coccinelle

[-- Attachment #1: Type: text/plain, Size: 563 bytes --]



On Sun, 28 Mar 2021, Markus Elfring wrote:

> > 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.
>
> How are the chances to add support for another program option like “--find-headers”?

In the last 15 years I have never wanted to do this.  And we already have
a huge number of command line options, so I'm not going to add this.

julia

>
> Will any other file filters become also relevant here?
>
> Regards,
> Markus
>

[-- Attachment #2: Type: text/plain, Size: 136 bytes --]

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-28 10:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-28  6:15 [Cocci] Searching only for header files with the Coccinelle software Markus Elfring
2021-03-28  9:27 ` Julia Lawall
     [not found]   ` <30240b24-99e5-eafb-c167-777ca1a6ec59@web.de>
2021-03-28 10:48     ` Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).