On Tue, 7 Aug 2012, Marion VOGT wrote:
> Le 06/08/2012 21:30, [email protected] a écrit :
> > Quoting Marion VOGT <[email protected]>:
> >
> > >
> > > Hello!
> > >
> > > I'm having trouble with this kind of for loop :
> > > for(int i=0; i<n; i++) {...}
> > >
> > > It seems that the code is not parsed at all because of the declaration of
> > > i.
> > >
> > > How could I manage to parse this?
> >
> > This is SmPL code, ie code in your semantic patch? I don't think this could
> > be supported. It should be easy to add, but I can't do it before the end of
> > the week.
> >
> > julia
> >
> >
> No it is C code.
OK, thanks. I will try to do something about it.
julia
> For example, this is the output of 'spatch --type-c' :
>
> init_defs_builtins: /usr/share/coccinelle/standard.h
> Type_annoter: no type found for: i
> WEIRD: not a comment:unsigned
> WEIRD: not a comment:i
> WEIRD: not a comment:=
> WEIRD: not a comment:1
> WEIRD: not a comment:;
> WEIRD: not a comment:i
> WEIRD: not a comment:<=
> WEIRD: not a comment:10
> WEIRD: not a comment:;
> WEIRD: not a comment:++
> WEIRD: not a comment:i
>
>
> #include <stdlib.h>
>
> int main(int argc, char *argv[])
> {
> char bStr[10/*int*/];
> for (unsigned i=1;i<=10;++i) {
> bStr/*char[10/*int*/], local*/[i/**/]/*char*/ = (char)i/**//*char*/ +
> 'a'/*char*//*int*//*char*/;
> }
> return 0/*int*/;
> }
>
> Coccinelle doesn't parse the code in the for parentheses.
>
>_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)