From: julia.lawall@lip6.fr (Julia Lawall)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Determination for the absence of an option in a function call
Date: Sat, 17 Feb 2018 18:44:07 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.20.1802171842050.2205@hadrien> (raw)
In-Reply-To: <b65bd20c-de90-2136-b375-246b873cf2a3@users.sourceforge.net>
On Sat, 17 Feb 2018, SF Markus Elfring wrote:
> >> It is easy to check the presence of such an identifier.
> >> But I find it very challenging to determine (by script code)
> >> if it is actually not passed (as an option) in a function call.
> >
> > It's not clear what you want.
>
> Another try ?
>
>
> > You will have to send some examples.
>
> When we look at concrete Linux source code, we mostly see that
> the option ?__GFP_NOWARN? is just missing for a call of a function
> like ?devm_kmalloc?.
>
> An other analysis tool can show the information that such an identifier
> is referenced only in 207 files (from Linux 4.16-rc1).
>
> But how can the Coccinelle software help here to exclude these source
> code places from specific transformation attempts?
(
f(...,<+...__GFP_NOWARN...+>,...)
|
transformation
)
Alternatively,
@ok@
position p;
@@
f(...,<+...__GFP_NOWARN...+>,...)
@@
position p != ok.p;
@@
- f at p(...)
+ whatever
>
>
> >> How would you manage the information which of the parameters
> >> would get the argument ?gfp? (for example)?
> >
> > You have to match the definition of the function to find out what
> > parameter position you are interested in.
>
> It seems to be feasible to encode such knowledge for a small number
> of function names (in SmPL disjunctions or regular expressions).
>
> But how does the software situation look like when you would like
> to automate the search for interesting positions as much as possible?
My iteration suggestion covers this case.
julia
next prev parent reply other threads:[~2018-02-17 17:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-17 16:00 [Cocci] Determination for the absence of an option in a function call SF Markus Elfring
2018-02-17 16:05 ` Julia Lawall
[not found] ` <2b678153-b7c0-6100-6d9c-624bd61e2b78@users.sourceforge.net>
2018-02-17 16:42 ` Julia Lawall
[not found] ` <a3c2fbd6-00f4-0113-aab8-4caeed631e1c@users.sourceforge.net>
2018-02-17 17:09 ` Julia Lawall
[not found] ` <b65bd20c-de90-2136-b375-246b873cf2a3@users.sourceforge.net>
2018-02-17 17:44 ` Julia Lawall [this message]
[not found] ` <d6ebe937-81ef-5556-7d00-f7b914521608@users.sourceforge.net>
2018-02-17 18:17 ` Julia Lawall
[not found] ` <81e498d6-294a-8542-9338-50ca8e96303c@users.sourceforge.net>
2018-02-17 19:05 ` [Cocci] Handling of variations in function call parameters Julia Lawall
[not found] ` <2a43676a-fdee-236c-221e-f75a6bcd24f2@users.sourceforge.net>
2018-02-17 19:47 ` [Cocci] Determination for the absence of an option in a function call Julia Lawall
[not found] ` <5e69411a-310d-f80b-6bd6-48158f5a1afd@users.sourceforge.net>
2018-02-17 20:25 ` Julia Lawall
[not found] ` <e0b2f3b9-28bc-f4d4-01fc-f80317926bc4@users.sourceforge.net>
2018-02-17 20:36 ` [Cocci] Checking for questionable error messages after failed memory allocations Julia Lawall
[not found] ` <ac659e87-6e0a-8c7a-dcd9-fe79035123d6@users.sourceforge.net>
2018-02-17 20:55 ` Julia Lawall
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=alpine.DEB.2.20.1802171842050.2205@hadrien \
--to=julia.lawall@lip6.fr \
--cc=cocci@systeme.lip6.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 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.