cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: Coccinelle <cocci@systeme.lip6.fr>
Subject: Re: [Cocci] Searching for global items in the source code
Date: Sat, 2 May 2020 07:56:52 +0200	[thread overview]
Message-ID: <96ecd52e-ffa6-87a3-ad45-79ad6ec6176e@web.de> (raw)
In-Reply-To: <alpine.DEB.2.21.2005011348250.2504@hadrien>

>> @display@
>> identifier action;
>> type return_type;
>> @@
>> *return_type action(...)
>>  {
>>  ...
>>  }
>>  EXPORT_SYMBOL(action);
> In this case, the problem entirely on your side.  You should separate the
> two top-level declarations into two separate rules, just like any other
> two top-level declarations you would like to match.

My SmPL script example affects the understanding of the software behaviour
also around the following information.
https://github.com/coccinelle/coccinelle/blob/a549b9f0a20e14fe9c36f45990b40dc5708ef8f2/docs/manual/cocci_syntax.tex#L1649

“…
All matching done by a SmPL rule is done intraprocedurally.
…”


* How are items represented from the global name space?

* Would the interpretation of the situation be adjusted if a macro call
  and a function implementation would be moved into an other usage context
  like a C++ class (or an enclosing function implementation)?


> You also need a
>
> declarer name EXPORT_SYMBOL;
>
> in the rule that you need to create for matching that part of the code.

Can it become interesting to match a macro call (or a similar annotation/attribute)
also without the declaration of such a metavariable?
https://github.com/coccinelle/coccinelle/blob/a549b9f0a20e14fe9c36f45990b40dc5708ef8f2/docs/manual/cocci_syntax.tex#L310

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

  parent reply	other threads:[~2020-05-02  5:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 11:43 [Cocci] Searching for exported Linux functions Markus Elfring
     [not found] ` <alpine.DEB.2.21.2005011348250.2504@hadrien>
2020-05-01 12:36   ` Markus Elfring
2020-05-02  5:56   ` Markus Elfring [this message]
2020-05-02  7:05     ` [Cocci] Searching for global items in the source code Julia Lawall
2020-05-02  7:43       ` Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=96ecd52e-ffa6-87a3-ad45-79ad6ec6176e@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@systeme.lip6.fr \
    --cc=julia.lawall@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).