cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: Coccinelle <cocci@systeme.lip6.fr>
Subject: Re: [Cocci] Deleting unused declarations for variables with SmPL?
Date: Thu, 27 Dec 2018 20:49:57 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.1812272049150.2393@hadrien> (raw)
In-Reply-To: <36f19c49-a6e9-11f1-2bb8-c22ad3ca8e54@users.sourceforge.net>



On Thu, 27 Dec 2018, SF Markus Elfring wrote:

> > If you have a problem, provide a complete example.
>
> Do you find software development difficulties easier
> to clarify based on source code analysis by a SmPL script
> like the following?
>
> @find@
> identifier f, x;
> type ft, xt;
> @@
>  ft f(...)
>  {
>  ... when any
>  xt x;
>  ... when != x
>  }
>
> @show@
> identifier find.f, find.x;
> type find.ft, find.xt;
> @@
>  ft f(...)
>  {
>  ... when any
>  xt x;
>  ...
> *x
>  ...
>  }

I don't know what you expect the second rule to do, but it will only match
when there exists a control-flow path through the function where x is
referenced exactly once.

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

  parent reply	other threads:[~2018-12-27 19:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-25 13:40 [Cocci] Deleting unused declarations for variables with SmPL? SF Markus Elfring
2018-12-25 13:45 ` Julia Lawall
     [not found]   ` <7d528a6a-33fd-c8ff-e703-c8ff47908e90@users.sourceforge.net>
2018-12-25 14:09     ` Julia Lawall
     [not found]   ` <a6c91cf5-4ff3-9088-0b58-b0039e495d58@users.sourceforge.net>
     [not found]     ` <alpine.DEB.2.21.1812251700080.8365@hadrien>
     [not found]       ` <88be4433-a617-056e-3dee-495a41e46110@users.sourceforge.net>
     [not found]         ` <alpine.DEB.2.21.1812251734590.8365@hadrien>
     [not found]           ` <afd513b0-e16a-a5ca-088f-244a31097f9d@users.sourceforge.net>
     [not found]             ` <f1884111-1762-b96e-7f08-c327704e5ba0@users.sourceforge.net>
     [not found]               ` <alpine.DEB.2.21.1812251823440.8365@hadrien>
     [not found]                 ` <ff650b4e-5058-e2d6-9815-4f8372ed32c1@users.sourceforge.net>
     [not found]                   ` <alpine.DEB.2.21.1812271622350.2457@hadrien>
     [not found]                     ` <36f19c49-a6e9-11f1-2bb8-c22ad3ca8e54@users.sourceforge.net>
2018-12-27 19:49                       ` Julia Lawall [this message]
2018-12-28  9:50                       ` 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.21.1812272049150.2393@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=cocci@systeme.lip6.fr \
    --cc=elfring@users.sourceforge.net \
    /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).