On Sat, Sep 15, 2012 at 5:31 PM, Julia Lawall <[email protected]> wrote:
> A partial solution to your problem is below.  The problems are as follows:
Thanks a lot.

>
> 1. Coccinelle has to be able to find the structure definition.  This is an
> intrinsic problem.  You will have to use the argument --all-includes or even
> --recursive-includes so that it will try to hunt around for the needed
> include files.  This will be slow.
>
> 2. If there is a mixture of c99 declarations and non-c99 declarations, the
> rule does nothing.
>
> 3. There is a lot of duplicated code, due to some useful features not being
> supported for structure initializers.
>
> 4. The rule only supports a simple structure or an array of structure.
>
> I can fix the second and third points.  But they don't really matter for
> using the rule.
>
> The rule actually works for any structure type name that you specify.  You
> do that using the argument
>
> -D ty=typename
>
> The rule could easily be generalized to work on all types, but I expect you
> don't want to bother with that.  So you would run spatch as follows:
>
> spatch --cocci-file file.cocci --dir linuxpath -D ty=typename
>
> To speed things up a bit, I would suggest adding the arguments
>
> --cache_prefix /tmp/coccicache --cache_limit 500
>

spatch -sp_file file.cocci   drivers/rtc/rtc-rs5c372.c -D ty=i2c_msg

init_defs_builtins: /usr/share/coccinelle/standard.h
339 340
Fatal error: exception Failure("minus: parse error:
 = File "c99.cocci", line 33, column 7,  charpos = 339
    around = 'a', whole content =   .i = a,

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

Reply via email to