1Most of the project now depends on the compiler supporting C99 variadic 2macros. This is used in the Debug() macro everywhere except libldap and 3its dependencies. 4 5From now on, any time Debug( level, fmt, args... ) is used, you can and 6should provide the appropriate number of arguments. The coccinelle 7patches in this directory implement the transformations used to bring 8the project in line with this. 9 10As we still aim to support libldap on platforms that only provide C89, 11Debug0/1/2/3 macros are used instead. 12 13If you need to adapt your own fork, see ITS#8731, the rest of this 14README and scripts in this directory on what you'll need to achieve 15this. 16 17Coccinelle as of git hash e65a7bdc04ac9122acdae2353422c5736b7998ba from 18https://github.com/coccinelle/coccinelle has been used to run the 19transformations performed. One notable limitation at the time of writing 20is that multi-part (format) strings are always merged onto the same line. 21 22Some sources cannot be processed, nssov overlay being a prime example, 23being wrapped in non-trivial macros. 24 25The following semantic patches are involved: 26- 03-libldap_Debug.cocci: converts the libraries to use the Debug[0123] 27 macros as appropriate 28- 04-variadic.cocci: converts the rest of the project to use the Debug 29 macro with the right number of arguments (as opposed to padding with 30 zeroes) 31- 09-merge.cocci will merge an 'snprintf(s, len, "fmt", args...); 32 Debug(level, "... %s ...", ..., s, ...);' sequence together 33- 07-shortcut.cocci is actually used to apply the above since 34 coccinelle's model-checker seems to struggle with state space 35 explosion in some of the very long and complex functions we have - 36 09-merge.cocci doesn't finish in any reasonable time 37 38The equivalence.iso and macros.h files aid coccinelle to parse our 39sources correctly and simplify the semantic patches. 40