On Sun, 10 Oct 2010, Vasiliy Kulikov wrote:

> Hi,
> 
> Is it possible to differ pointers and array names?

I doubt that this is supported properly now.

The short term solution would be to match the things you don't want, and 
then use another rule to match everything else:

@r@
position p;
@@

thing_you_dont_w...@p

@@
position p != r.p;
@@

thing_you_do_w...@p

julia

> Currently coccinelle thinks that they are the same.  But it's not true,
> at least they have different sizes:
> 
> @@
> type T;
> T* x;
> @@
> 
> *sizeof(x)
> --
> 
>      printf("sizeof(\"123\") = %d, sizeof((char*)\"123\") = %d\n", 
> -            sizeof("123")     ,
> -            sizeof((char*)"123"));
> 
> 
> //output on x86_64:
> sizeof("123") = 4, sizeof((char*)"123") = 8
> 
> 
> 
> Thanks,
> 
> -- 
> Vasiliy
> _______________________________________________
> Cocci mailing list
> [email protected]
> http://lists.diku.dk/mailman/listinfo/cocci
> (Web access from inside DIKUs LAN only)
> 
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to