>>>> Another example:
>>>> “[PATCH] coccinelle: improve array.cocci” from 2019-11-18
>>>> https://public-inbox.org/git/0d9cf772-268d-bd00-1cbb-0bbbec9df...@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-49fcbd65a...@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-795af612d...@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 via email to