On Tue, 16 Nov 2010, Vasiliy Kulikov wrote: > On Tue, Nov 16, 2010 at 09:22 +0100, Julia Lawall wrote: > > > I thought that > > > (s)size_t may be equal to int, long or long long depending on current > > > arch and command line arguments. > > > > Sorry, but I'm still not sure what Coccinelle is supposed to do with the > > information about the size of size_t. > > E.g. this one: > > @@ > ssize_t x; > expression e; > @@ > > ( > x > | > *e > ) > = read(...) > > Result of read(2) must be stores in ssize_t. If int is the same as > ssize_t then it's OK, otherwise it is a bug.
That's fine, and the type is there, so you can make such a rule, but it has nothing to do with the number of bits in a size_t or ssize_t value. We have the -int_bits option so that if eg int_bits is set to 2, then an int metavariable won't match 256, but I don't think that a size_t_bits option would be useful in the same way. julia _______________________________________________ Cocci mailing list [email protected] http://lists.diku.dk/mailman/listinfo/cocci (Web access from inside DIKUs LAN only)
