On Thu, 4 Nov 2010, Vasiliy Kulikov wrote:
> On Thu, Nov 04, 2010 at 19:00 +0100, Julia Lawall wrote:
> > On Thu, 4 Nov 2010, Vasiliy Kulikov wrote:
> > > (b) architecture-dependent sizeof(int)
> >
> > I would have no idea how to do this, because Coccinelle is not necessarily
> > run on the architecture that the code is associated with. Perhaps the
> > number of bits in an int could be a command line argument.
>
> I'm OK with it. If you think it is consistent with coccinelle's
> semantic, then I suggest to do this:
>
> -sizeof-int={2,4,8,any}
> -sizeof-long={2,4,8,any}
> (I don't know any arch where sizeof(short) != 2 and where sizeof(long)
> == 2, however.)
>
> "any" is all combinations of possible sizeof()s (I mean not breaking
> 2 <= sizeof(short) <= sizeof(int) <= sizeof(long)).
>
> Default value is some sane value for the current architecture, e.g.
> gcc's choise.
Actually, this was all already implemented. It's even in the manual :)
-int_bits n and -long_bits n
julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)