Use the gpgrt log functions if possible.
authorWerner Koch <wk@gnupg.org>
Mon, 27 Nov 2017 14:00:25 +0000 (15:00 +0100)
committerWerner Koch <wk@gnupg.org>
Mon, 27 Nov 2017 14:00:25 +0000 (15:00 +0100)
commitb56dfdfc1865ceb7c3c025d79996e049faee7fdf
tree60349bcb51ed47c3c5ed158740df1c245d187939
parentfe96ca8d86881a611816a6de4047f00c69325ea5
Use the gpgrt log functions if possible.

* common/logging.c: Do not build any code if we can use the gpgrt_log
functions.
(log_logv_with_prefix): Rename to log_logv_prefix and change order of
args so that this function matches its printf like counterpart
gpgrt_logv_prefix.  Change all callers.
(log_debug_with_string): Rename to log_debug_string. Change all
callers.
(log_printhex): Move first arg to end so that this function matches
its printf like counterpart gpgrt_log_printhex.  Change all callers.
* common/logging.h: Divert to gpgrt/libgpg-error if we can use the
gpgrt_log functions.
(bug_at): Add inline versions if we can use the gpgrt_log functions.
* configure.ac (GPGRT_ENABLE_LOG_MACROS): Add to AH_BOTTOM.
(mycflags): Add -Wno-format-zero-length.
--

This patch enables the use of the log function from libgpgrt (aka
libgpg-error).  Instead of checking a version number, we enable them
depending on macros set by recent gpg-error versions.  Eventually the
whole divert stuff can be removed.

The -Wno-format-zero-length is required because log_printhex can be
called with an empty format string.  Note that this is fully specified
standard C behaviour.

Signed-off-by: Werner Koch <wk@gnupg.org>
25 files changed:
agent/cvt-openpgp.c
agent/divert-scd.c
agent/pkdecrypt.c
common/logging.c
common/logging.h
configure.ac
dirmngr/crlcache.c
dirmngr/dirmngr.c
dirmngr/http.c
dirmngr/misc.c
g10/ecdh.c
g10/encrypt.c
g10/keyid.c
g10/pubkey-enc.c
g13/call-syshelp.c
g13/g13tuple.c
scd/apdu.c
scd/app-openpgp.c
scd/app-p15.c
sm/certcheck.c
sm/certdump.c
sm/decrypt.c
sm/fingerprint.c
sm/import.c
sm/verify.c