On Mon, 8 Nov 2010, Vasiliy Kulikov wrote:

> Hi,
> 
> Similar type mistake:
> 
> @@
> int x;
> @@
> 
> *x
> 
> --- main.c  2010-11-08 22:06:37.000000000 +0300
> +++ /tmp/cocci-output-4087-147ea3-main.c    2010-11-08
> 22:06:44.000000000 +0300
> @@ -10,6 +10,4 @@ int
>  main(int argc, char **argv)
>  {
>      int *a, *b;
> -    a-b;
> -    return 0;
>  }
> --
> 
> 
> pointer - pointer is (strictly speaking ;)) is prtdiff_t.  AFAIK it may
> be OK to represent it as size_t.

Isn't size_t unsigned?

julia

> Also about size_t/ssize_t: I'm not CPU architectures guru, but there is
> no limit in ANSI that size_t is long.  AFAIU sizeof(size_t) may be <
> sizeof(long), so maybe introduce new option -sizeof-size_t=XX with
> default value == sizeof(long)?
> 
> 
> Thanks,
> 
> -- 
> Vasiliy
> 
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to