On Wed, 5 Jul 2017, Ondřej Kuzník wrote:

> On Wed, Jul 05, 2017 at 02:20:53PM +0200, Julia Lawall wrote:
> > The issue of the deleted comment should be addressed.
>
> Thanks, I can confirm it does the right thing for me.
>
> I have started compiling the result and there seem to be a few issues:
>
> The following rule when applied to servers/slapd/sl_malloc.c will result
> in a syntax error since the string on line 408 gets split across several
> lines:
>
> @@
> format list[2] two;
> expression E, A1, A2;
> @@
>
> -Debug( E, "%@two@", A1, A2, 0 );
> +Debug( E, "%@two@", A1, A2 );

You can avoid the problem by writing the rule as:

@@
format list[2] two;
expression E, A1, A2;
@@

Debug( E, "%@two@", A1, A2
-, 0
 );

Note that Coccinelle will not leave a space before the final ).

julia

>
> Another issue with the same rule is in servers/slapd/daemon.c, the
> first hunk tries to change a multiline macro, but fails to keep the
> backslashes in place.
>
> Also, the following patch does not actually pick up anything in
> servers/slapd/connection.c, where I would have expected lines 1402
> and 1849 to match. What would be the reason?
>
> @@
> format list[5] five;
> expression E, A1, A2, A3, A4, A5;
> @@
>
> -Statslog( E, "%@five@", A1, A2, A3, A4, A5 );
> +Debug( E, "%@five@", A1, A2, A3, A4, A5 );
>
> Thanks,
>
> --
> Ondřej Kuzník
> Senior Software Engineer
> Symas Corporation                       http://www.symas.com
> Packaged, certified, and supported LDAP solutions powered by OpenLDAP
>
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to