I added size_t, ssize_t, and ptrdiff_t to Coccinelle (smpl and C code).  
Metavariables can be declared of all three types.  The return type of 
sizeof is size_t.  The return type of a pointer difference is ptrdiff_t.  
Combining another non-float value with a ptrdiff_t is a ptrdiff_t.
Othersise, combining another non-float value with a ssize_t is a ssize_t.
Othersise, combining another non-float value with a size_t is a size_t.

It also occurred to me that in eg sizeof(*x), where x has type int *, the 
reference to *x is not really a reference to an integer value, and the 
reference to x is not really a reference to an integer pointer value.  
Thus there is no longer any type inference for the argument to sizeof.  If 
this seems like a bad decision, please let me know and I will change it 
back.

Also, if there are any other type problems please let me know.

julia

_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to