On Thu, May 19, 2011 at 11:10 AM, Francis Galiegue <[email protected]> wrote: > On Thu, May 19, 2011 at 10:47, Nicolas Palix <[email protected]> wrote: > [...] >> >> Is the following code working as you intent ? >> >> >> @@ >> expression E; >> @@ >> >> ( >> vstralloc(..., NULL) >> | >> * vstralloc(....,E) >> ) >> > > No... Maybe I use too old a version of Coccinelle for this to work (0.2.5)?
0.2.5 is fine. I just figure out that the second vstralloc is followed by four dots instead of three... The other solutions are fine too. > > I have been given the solution on IRC: > > @ correct @ > position p; > @@ > vstralloc@p(...,NULL) > > @ incorrect @ > position p != correct.p; > @@ > vstralloc@p(... > + ,NULL > ) > > But then I found a simpler one: > > @@ > expression E != NULL; > @@ > > vstralloc(..., E > + , NULL > ) > > > OK, it is all starting to sink in. Sloooowly... > -- > Francis Galiegue, [email protected] > "It seems obvious [...] that at least some 'business intelligence' > tools invest so much intelligence on the business side that they have > nothing left for generating SQL queries" (Stéphane Faroult, in "The > Art of SQL", ISBN 0-596-00894-5) > _______________________________________________ > Cocci mailing list > [email protected] > http://lists.diku.dk/mailman/listinfo/cocci > (Web access from inside DIKUs LAN only) > -- Nicolas Palix http://sardes.inrialpes.fr/~npalix/ _______________________________________________ Cocci mailing list [email protected] http://lists.diku.dk/mailman/listinfo/cocci (Web access from inside DIKUs LAN only)
