[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#8731) Variadic Debug() macro

Full_Name: Ondrej Kuznik
Version: master
URL: ftp://ftp.openldap.org/incoming/debug_macro_refactor.tgz
Submission from: (NULL) (

The patch series in the linked archive changes the logging macros to be fully
- 00-fixes.patch - fixes proposed in ITS#8730
- 01-logging.patch updates the macros themselves
- 02-manual.patch updates some legal but unnecessary constructs
- 03-variadic.patch (generated from 03-variadic.cocci against today's master
20e46d84948be3127f6145d4f65437091bb87580) replaces the current Debug(level,
"fmt", 0, 0, 0) with Debug(level, "fmt"), etc.
- 04-back-sql.patch updates parts of back-sql that coccinelle cannot currently
- 05-nssov.patch updates nssov where coccinelle cannot see past some of the
- 06-shortcut.patch (generated from 06-shortcut.cocci) replaces the
snprintf(buf);Debug("fmt", buf) workaround with Debug()
- 07-snprintf-manual.patch updates what coccinelle cannot pick up without
- (nonexistent 08-merge.patch which would be generated by 08-merge.cocci if it
could process servers/slapd/back-asyncmeta/search.c without timing out)

Where a corresponding .cocci file is present, the patch has been generated with
coccinelle[0] as of commit 42e4638bfacf13ab1a8acc35b40e216e34087578. To
regenerate them (perhaps against a different OpenLDAP branch), the following
command line can be used:

spatch --timeout 300 --macro-file-builtins macros.h -dir --sp-file <cocci file>
--dir .

This will generate a patch on stdout, or, with "--in-place", will effect the
changes directly on the source tree. The existence of 06-shortcut.cocci would
not normally be necessary if the organisation of the file
servers/slapd/back-meta/search.c did not cause coccinelle to take days to
process it. This file is included for anyone trying to make sure the cleanup is
complete even when some of the things that hold in OpenLDAP's master branch
would not. Because of an oversight, this also means 08-merge.cocci does not
perform all the clean up that 06-shortcut.cocci does and would need to be

The attached file is derived from OpenLDAP Software. All of the modifications to
OpenLDAP Software represented in the following patch(es) were developed by
Ond&#345;ej Kuzník <okuznik@symas.com>. I have not assigned rights and/or
interest in this work to any party.

The attached semantic patches and modifications to OpenLDAP Software are
to the following notice:

Copyright 2017, Ond&#345;ej Kuzník <okuznik@symas.com>, Symas Corporation

Redistribution and use in source and binary forms, with or without modification,
are permitted only as authorized by the OpenLDAP Public License.