Actually, the third rule should be unnecessary. When you change the header of a function, it should generate a rule to change the prototype as well. Let me know if this doesn't happen.

If it doesn't happen you could try not removing and adding back the function name.

julia

On Tue, 28 Feb 2012, ron minnich wrote:

I'm stuck on something I thought I knew how to do.

The first two rules in this file work, the third (which I just added)
fails. The goal is to change instances of the function, uses of the
struct, and
prototype declarations of the function. I'm doing something simple
wrong. I realize I could use alternation but I'm still learning.

thanks

ron

[rminnich@myhost video]$ cat deldev.cocci
@@
identifier func;
identifier d;
@@
-func(struct drm_device *d)
+func(void)
{...}
@@
identifier dev;
expression i;
@@
-struct drm_i915_private *dev = i;
@@
identifier func;
identifier d;
@@
-func(struct drm_device *d);
+func(void);

The error is as follows:

[rminnich@myhost video]$ spatch --in-place -sp_file deldev.cocci ib.c
init_defs_builtins: /usr/local/share/coccinelle/standard.h
217 218
Fatal error: exception Failure("minus: parse error:
= File "deldev.cocci", line 17, column 25,  charpos = 217
   around = 'd', whole content = -func(struct drm_device *d);
")
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

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

Reply via email to