All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Cocci] Excluding function names in SmPL rules
@ 2020-06-03  8:23 Markus Elfring
  2020-06-03  9:09 ` Paul Chaignon
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2020-06-03  8:23 UTC (permalink / raw)
  To: Paul Chaignon; +Cc: cocci

> I couldn't find a way to do that from the first rule, so I whitelisted
> send_drop_notify() with a second rule (rule2 below). That seems rather
> cumbersome and I'm wondering if there's maybe a simpler approach?

Do you find the following source code search approach helpful for
your software development needs?

@display@
identifier fn != send_drop_notify;
type t;
@@
 t fn(...)
 {
 ... when any
(ep_tail_call(...);
 ... when forall
 return DROP_MISSED_TAIL_CALL;
|
*ep_tail_call(...);
)
 ... when any
 }


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] Excluding function names in SmPL rules
  2020-06-03  8:23 [Cocci] Excluding function names in SmPL rules Markus Elfring
@ 2020-06-03  9:09 ` Paul Chaignon
  2020-06-03 11:04   ` Markus Elfring
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Chaignon @ 2020-06-03  9:09 UTC (permalink / raw)
  To: Markus Elfring; +Cc: cocci

On Wed, Jun 03, 2020 at 10:23:59AM +0200, Markus Elfring wrote:
> > I couldn't find a way to do that from the first rule, so I whitelisted
> > send_drop_notify() with a second rule (rule2 below). That seems rather
> > cumbersome and I'm wondering if there's maybe a simpler approach?
> 
> Do you find the following source code search approach helpful for
> your software development needs?

No. It's the first approach I tried and it didn't match anything anymore;
I couldn't figure out why. It's the approach I was referring to by 'When I
tried using rule1 as the body of the function in rule2, it just didn't
match anything anymore'.

Paul

> 
> @display@
> identifier fn != send_drop_notify;
> type t;
> @@
>  t fn(...)
>  {
>  ... when any
> (ep_tail_call(...);
>  ... when forall
>  return DROP_MISSED_TAIL_CALL;
> |
> *ep_tail_call(...);
> )
>  ... when any
>  }
> 
> 
> 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] Excluding function names in SmPL rules
  2020-06-03  9:09 ` Paul Chaignon
@ 2020-06-03 11:04   ` Markus Elfring
  0 siblings, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2020-06-03 11:04 UTC (permalink / raw)
  To: Paul Chaignon; +Cc: cocci

>> Do you find the following source code search approach helpful for
>> your software development needs?
>
> No.

It is a pity that this SmPL example does still not work in the way
which you expect so far.


> It's the first approach I tried and it didn't match anything anymore;
> I couldn't figure out why.

How many efforts would you like to invest in further clarification?

I hope otherwise that other known developers will share additional
solution ideas (besides the application of script rules with OCaml
or Python).


> It's the approach I was referring to by 'When I tried using rule1
> as the body of the function in rule2, it just didn't match anything anymore'.

I assumed that this test variant was eventually incomplete.
Would you like to point any source files out for another test
around evolving software transformation patterns?

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

end of thread, other threads:[~2020-06-03 11:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-03  8:23 [Cocci] Excluding function names in SmPL rules Markus Elfring
2020-06-03  9:09 ` Paul Chaignon
2020-06-03 11:04   ` Markus Elfring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.