cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Nicholas Mc Guire <der.herr@hofr.at>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: cocci@systeme.lip6.fr
Subject: Re: [Cocci] detecting false positive sparse with coccinelle
Date: Tue, 30 Apr 2019 05:26:49 +0200	[thread overview]
Message-ID: <20190430032649.GA23144@osadl.at> (raw)
In-Reply-To: <alpine.DEB.2.21.1904291221350.2444@hadrien>

On Mon, Apr 29, 2019 at 12:26:49PM -0400, Julia Lawall wrote:
> 
> 
> On Mon, 29 Apr 2019, Nicholas Mc Guire wrote:
> 
> >
> > Hi !
> >
> >  I'm trying to detect false positive sparse messages by taking
> >  the pattern and scanning with coccinelle for it so that the
> >  fix could be generated. Basically the identification seems
> >  to be working (a type-check on var is stil missing - but thats
> >  a different issue) - the problem though is that I'm unable
> >  to insert the (__force __be16) cast in the patch rule as
> >  coccinelle is refusing hose lines. Any hint how that could be
> >  done or is the problem the syntactic oddity of having a
> >  unknown keyworkd followed by a type that is confusing coccinelle
> >  here ?
> 
> Types like this are currently not parsed properly - see the GSoC project.
> I'm not sure that there is a good solution at the moment.  This should be
> parsed OK by the C parser, so you could try passing through python.  See
> python_mdecl.cocci.  It may be necessary to construct the complete
> expression (__force __be16)var in python.
>
ok - so I guess this means the issue applies to all type attributes
then. Using python might be doable but the goal is to not grow the
number of involved tools - there are already too many anyway.
I'll try poking around in coccinelle then - not sure how hard that 
would be to add that - something like an typedef equivalent called
attributedef would be my first guess.

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

  reply	other threads:[~2019-04-30  3:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29  6:05 [Cocci] detecting false positive sparse with coccinelle Nicholas Mc Guire
2019-04-29 14:42 ` [Cocci] Detecting false positive sparse with Coccinelle Markus Elfring
2019-04-29 16:26 ` [Cocci] detecting false positive sparse with coccinelle Julia Lawall
2019-04-30  3:26   ` Nicholas Mc Guire [this message]
2019-04-30 10:56     ` 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=20190430032649.GA23144@osadl.at \
    --to=der.herr@hofr.at \
    --cc=cocci@systeme.lip6.fr \
    --cc=julia.lawall@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 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).