On Wed, 22 Sep 2010, Greg McGary wrote:

>  I want to change all *ioctl function decls to return int and to use
> uintptr_t as their arg type.  The following causes sparse to barf.
> I stared at the documentation, examples and grammar for awhile, but
> my spatch is so small and simple, I just don't see what's wrong.

In Coccinelle, you have to specify a complete term.  You have only given a 
function header.  If you mean to be transforming the prototype, then you 
should put a ; at the end.  If you mean to transform the definition, you 
should put { ... } at the end.  If you transform the definition, it will 
automatically make an extra rule for transforming the prototype.

julia


> Thanks in advance,
> G
> 
> ---------------- snip snip ----------------
> @@
> identifier foo_ioctl ~= ".*ioctl";
> type T;
> identifier arg;
> @@
> - T
> + int
> foo_ioctl (...,
> - unsigned long
> + uintptr_t
> arg)
> ---------------- snip snip ----------------
> 
> $ spatch -sp_file ioctl.cocci -dir .
> init_defs_builtins: /usr/share/coccinelle/standard.h
> 137 137
> Fatal error: exception Failure("minus: parse error:
>  = File "ioctl.cocci", line 16, column 0,  charpos = 137
>     around = '', whole content =
> ")
> 
> 
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to