Hi Markus,

On Thu, 2016-05-12 at 05:35:58 +0200, SF Markus Elfring wrote:
> > I think I have a test case that is minimal.
> 
> How do you think about to try a bit more fine-tuning out for the shown
> Coccinelle scripts?
>
> How much will it matter for your change pattern to specify only the
> deletion of the qualifier "const" from a data type of a function
> parameter while leaving the corresponding metavariable "T" untouched?

Well, is there anything wrong with my patches? I don't argue that they
could be optimized but as long as there is nothing wrong with them
things should work, shouldn't they?
Does your changed version behave correctly in all cases?

> 
> @removal@
> identifier F, I;
> type T;
> @@
>  F(...,
> -  const
>    T I,
>   ...
>  );

I guess that is a valid optimization. But does this go through the
parsing step? And even if, why doesn't mine?

> By the way: Do you care how often a "const" might appear within a data type?

No, I don't. My goal was to get rid of all const qualifiers that affect
local variables only. E.g.:
 - const int foo => int foo
 - const int *foo => const int *foo (data pointed to shall remain const)
 - const int * const foo => const int *foo

        Sören
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to