Full_Name: Pierre Chapuis Version: OS: macOS / iOS URL: ftp://ftp.openldap.org/incoming/ Submission from: (NULL) (90.79.254.46)
Apple compilers (and probably others) do not allow calling sprintf with fewer arguments than the format calls for.
The warning is:
mdb.c:10720:46: warning: data argument not used by format string [-Wformat-extra-args] (int)mr[i].mr_pid, (size_t)mr[i].mr_tid, txnid);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf' __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) ^~~~~~~~~~~
Proposed patch against current LMDB sterer:
diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 79a958b..84afe4f 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -10715,9 +10715,13 @@ mdb_reader_list(MDB_env *env, MDB_msg_func *func, void *ctx) for (i=0; i<rdrs; i++) { if (mr[i].mr_pid) { txnid_t txnid = mr[i].mr_txnid; - sprintf(buf, txnid == (txnid_t)-1 ? - "%10d %"Z"x -\n" : "%10d %"Z"x %"Y"u\n", - (int)mr[i].mr_pid, (size_t)mr[i].mr_tid, txnid); + if (txnid == (txnid_t)-1) { + sprintf(buf, "%10d %"Z"x -\n", + (int)mr[i].mr_pid, (size_t)mr[i].mr_tid); + } else { + sprintf(buf, "%10d %"Z"x %"Z"u\n", + (int)mr[i].mr_pid, (size_t)mr[i].mr_tid, txnid); + } if (first) { first = 0; rc = func(" pid thread txnid\n", ctx);