[Cocci] Re: Cryptic "minus: parse error:". Please help diagnose

Greg McGary greg at mcgary.org
Wed Sep 22 20:02:33 CEST 2010


 On 09/22/10 10:51, 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.
>
> Thanks in advance,
> G
>
> ---------------- snip snip ----------------
> @@
> identifier foo_ioctl ~= ".*ioctl";
> type T;
> identifier arg;
> @@
> - T
> + int
> foo_ioctl (...,
> - unsigned long
> + uintptr_t
> arg)

Solved.  Adding { ... } to represent the function body did the trick:

@ioctl_arg@
identifier foo_ioctl ~= ".*ioctl";
type T;
identifier arg;
@@
- T
+ int
  foo_ioctl (...,
- unsigned long
+ uintptr_t
  arg) { ... }

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.diku.dk/pipermail/cocci/attachments/20100922/ce311e07/attachment.htm


More information about the Cocci mailing list