cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: Coccinelle <cocci@systeme.lip6.fr>
Subject: Re: [Cocci] Concerns around type safety for usage of expressions
Date: Fri, 22 Nov 2019 14:17:47 +0100	[thread overview]
Message-ID: <388a4927-6321-a4d6-a65d-265dfd2a5637@web.de> (raw)
In-Reply-To: <alpine.DEB.2.21.1911221351470.2793@hadrien>

>>>> 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.

It seems that you saw a a bit of SmPL code which I proposed to delete.

I suggest to take another look at the corresponding discussion.
https://public-inbox.org/git/d291ec11-c0f3-2918-193d-49fcbd65a18e@web.de/


I assume that this feedback might fit also to the clarification request
for the topic “Data processing with pointer types/expressions”.
https://lore.kernel.org/cocci/f1522779-5d10-a1d1-0555-795af612d8b3@web.de/
https://systeme.lip6.fr/pipermail/cocci/2019-November/006609.html


>> 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.

Such information can be fine itself.


> If Coccinelle cannot figure out the type of an expression,
> x will not be able to match that expression.

This aspect can become more interesting.

* Do you suggest here to use such type metavariables together with
  expression metavariables?

* Can the data type determination become better documented?

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

  reply	other threads:[~2019-11-22 13:18 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
2019-11-22 13:17                   ` Markus Elfring [this message]
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=388a4927-6321-a4d6-a65d-265dfd2a5637@web.de \
    --to=markus.elfring@web.de \
    --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).