On Wed, Jul 05, 2017 at 10:38:32PM +0200, Julia Lawall wrote:
>> @@
>> 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 );
> 
> The problem is the macro LDAP_PF_LOCAL_SENDMSG_ARG that is used in
> contexts like:
> 
>       c = connection_init( sfd, (Listener *)&dummy_list, "", "",
>               CONN_IS_CLIENT, 0, NULL
>                 LDAP_PF_LOCAL_SENDMSG_ARG(NULL));
> 
> Note the lack of a comma after NULL.  Putting the following in a file
> con.h:
> 
> #define LDAP_PF_LOCAL_SENDMSG_ARG(x)
> 
> and then using
> 
> spatch f5.cocci -macro-file-builtins ~/incoming/con.h 
> ~/openldap/servers/slapd/connection.c
> 
> gives the expected result.

Thanks, good thing is make test now seems to pass for the first round of
patches.

Actually, I'm now having a similar issue with ./servers/slapd/daemon.c,
spatch --parse-c will complain about the SLAP_EVENT_DECL macro and I can
see other issues with LDAP_LIST/LDAP_STAILQ/... macros in the output.

This patch is the one that's affected (among others), it will make some
changes, applying them and then running it again will make more until
eventually managing to pick up most or all of the ones that I'd expect:

@@
format list[2] fmt;
expression list[2] args;
expression E;
@@

Debug( E, "%@fmt@", args
-, 0
 );

@@
format list[1] fmt;
expression list[1] args;
expression E;
@@

Debug( E, "%@fmt@", args
-, 0, 0
 );

@@
expression E, S;
@@

Debug( E, S
-, 0, 0, 0
 );

Is there a way to work around that somehow?

Thanks,
Ondrej

-- 
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