On Thu, 18 Aug 2011, Vasiliy Kulikov wrote:
> Hi,
>
> Is it possible to somehow use C expressions to filter coccinelle output?
> Specifically, I have to find all structure definitions, which are
> smaller than X bytes.
>
> struct st_1 { ... };
>
>
> (the syntax is wrong, it just shows what I mean:)
>
> @@
> identifier x | sizeof(struct x) < 12;
> @@
>
> *struct x {
> ...
> };
There is no easy way to do this. The hard way would be to use python or
ocaml to write the code of interest to a file, compile and run the file,
read the output and use cocci.include_match(false) if it is not
acceptable.
I have never actually tried this :)
julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)