On Sun, 29 Aug 2010, Vasiliy Kulikov wrote:

> Hi,
> 
> It seems to me that coccinelle doesn't know that the result of 'a -= b'
> is the left operand, not the right, see this:

Thanks for the bug report.  I will fix it.

julia

> va...@albatros:~/src/test$ cat main.c
> int
> main(int argc, char **argv)
> {
>     int x;
> 
>     if ((x += (unsigned int)1) > 0)
>     ;
> }
> va...@albatros:~/src/test$ cat main.cocci 
> @@
> type T;
> unsigned T x;
> @@
> 
> * x > 0
> va...@albatros:~/src/test$ spatch -sp_file main.cocci main.c
> init_defs_builtins: /usr/share/coccinelle/standard.h
> HANDLING: main.c
> diff = 
> --- main.c  2010-08-29 16:13:04.000000000 +0400
> +++ /tmp/cocci-output-21345-f4fecc-main.c   2010-08-29
> 16:14:07.000000000 +0400
> @@ -9,6 +9,5 @@ main(int argc, char **argv)
>  {
>      int x;
>  
> -    if ((x += (unsigned int)1) > 0)
>      ;
>  }
> 
> 
> 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