cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Coccinelle <cocci@systeme.lip6.fr>
Subject: Re: [Cocci] Concerns around type safety for usage of expressions
Date: Fri, 22 Nov 2019 13:53:04 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.1911221351470.2793@hadrien> (raw)
In-Reply-To: <599a5c47-75c5-f0a8-afe9-3563a20b70d3@web.de>

[-- Attachment #1: Type: text/plain, Size: 769 bytes --]



On Fri, 22 Nov 2019, Markus Elfring wrote:

> >> Another example:
> >> “[PATCH] coccinelle: improve array.cocci” from 2019-11-18
> >> https://public-inbox.org/git/0d9cf772-268d-bd00-1cbb-0bbbec9dfc9a@web.de/
> >
> > OK, so you already know how to express type constraints for things.
>
> Where do you see that I did this?

T *ptr for example.

>
>
> > So what are you actually asking?
>
> I hope that another clarification variant can also help.
>
> How can the C data type be determined for an expression metavariable
> so that it could be used for subsequent source code searches?

@@
type T;
T x;
@@

Now after matching x, you can use both x and T.  If Coccinelle cannot
figure out the type of an expression, x will not be able to match that
expression.

julia

[-- Attachment #2: Type: text/plain, Size: 136 bytes --]

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

  reply	other threads:[~2019-11-22 12:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22  9:24 [Cocci] Concerns around type safety for usage of expressions Markus Elfring
2019-11-22  9:27 ` Julia Lawall
2019-11-22  9:45   ` Markus Elfring
2019-11-22  9:50     ` Julia Lawall
2019-11-22 10:00       ` Markus Elfring
2019-11-22 10:34         ` Julia Lawall
2019-11-22 10:44           ` Markus Elfring
     [not found]             ` <alpine.DEB.2.21.1911221155320.2793@hadrien>
2019-11-22 11:20               ` Markus Elfring
2019-11-22 12:53                 ` Julia Lawall [this message]
2019-11-22 13:17                   ` Markus Elfring
2019-11-22 14:56                   ` Markus Elfring
2019-11-22 15:10                     ` Julia Lawall
2019-11-22 15:19                       ` Markus Elfring
2019-11-23  7:55                       ` [Cocci] Checking influence of variability with SmPL Markus Elfring
2019-11-23 19:36                         ` Julia Lawall
2019-11-24 10:40                           ` 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=alpine.DEB.2.21.1911221351470.2793@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=Markus.Elfring@web.de \
    --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 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).