[Cocci] Parsing errors in several headers

Julia Lawall julia.lawall at lip6.fr
Tue Oct 28 19:33:17 CET 2014


On Tue, 28 Oct 2014, Jean-Sébastien Pédron wrote:

> Hi!
>
> I'm very new to Coccinelle and I don't understand why spatch(1) returns
> parsing errors on some headers and what I can do about that.
>
> == First example ==
>
> Header to parse:
> https://github.com/freebsd/freebsd/blob/master/sys/ofed/include/linux/bitops.h
>
> Full spatch command line and output:
> http://pastebin.com/DbNhBAF7
>
> spatch(1) fails to parse the #define at the end of the header. This
> #define starts a for() loop and uses functions declared ealier in the
> same file.

Do you need to match or transform some code that is related to this?  If
not, it doesn't matter.

julia

> == Second example ==
>
> Header to parse:
> https://github.com/freebsd/freebsd/blob/master/sys/ofed/include/linux/spinlock.h
>
> Full spatch command line and output:
> http://pastebin.com/C0h5ZN7r
>
> Here, it doesn't like the last #define again. This #define calls other
> macros defined in other headers.
>
> FYI, I'm using Coccinelle 1.0.0rc19 on FreeBSD.
>
> Can somebody help me understand what's wrong here?
>
> Thanks!
>
> --
> Jean-Sébastien Pédron
>
>


More information about the Cocci mailing list