On Thu, 2010-09-09 at 08:28 +0200, Julia Lawall wrote:
> you could also just add a second rule to your semantic match:
> 
> @@
> identifier I;
> @@
> 
> * struct pci_driver I { .name = ..., };

That doesn't seem to work.

$ cat find_pci_name.cocci
@@
identifier I;
@@

* struct pci_driver I { .name = ..., }
$ cat foo.c
#include <linux/kernel.h>
#include <linux/pci.h>

static struct pci_driver foo = {
        .name = "name",
};

static struct pci_driver bar = {
        NULL, "name"
};
$ spatch -version
spatch version 0.2.2 with Python support
$ spatch -sp_file find_pci_name.cocci foo.c
init_defs_builtins: /usr/local/share/coccinelle/standard.h
43 44
Fatal error: exception Failure("minus: parse error: 
 = File "find_pci_name.cocci", line 5, column 22,  charpos = 43
    around = '{', whole content = * struct pci_driver I { .name = ..., };
")
$

How would it find a non-c90 initializer like bar?



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

Reply via email to