From 9a76b0a0089c6c75df069a64cdb49e668013199e Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Tue, 24 Mar 2015 13:29:55 +0300 Subject: [PATCH] liblmdb: fix warnings in lmdb-tools. Change-Id: I1a1de4bcb9ce9b27f9278f74535e6e83de25bad0 --- Makefile | 2 +- mdb_copy.c | 2 +- mdb_stat.c | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d84c8707..01e07f21 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ # read mdb.c before changing any of them. # CC = gcc -W = -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized +W = -Wall -Werror -Wno-unused-parameter THREADS = -pthread XCFLAGS ?= $(CFLAGS) OPT = -O2 -g diff --git a/mdb_copy.c b/mdb_copy.c index dea591f5..81271504 100644 --- a/mdb_copy.c +++ b/mdb_copy.c @@ -30,7 +30,7 @@ sighandle(int sig) int main(int argc,char * argv[]) { int rc; - MDB_env *env; + MDB_env *env = NULL; const char *progname = argv[0], *act; unsigned flags = MDB_RDONLY; unsigned cpflags = 0; diff --git a/mdb_stat.c b/mdb_stat.c index f7be3d15..dbf3c8c3 100644 --- a/mdb_stat.c +++ b/mdb_stat.c @@ -134,6 +134,10 @@ int main(int argc, char *argv[]) mei.me_tail_txnid, mei.me_tail_txnid - mei.me_last_txnid); printf(" Max readers: %u\n", mei.me_maxreaders); printf(" Number of readers used: %u\n", mei.me_numreaders); + } else { + /* LY: zap warnings from gcc */ + memset(&mst, 0, sizeof(mst)); + memset(&mei, 0, sizeof(mei)); } if (rdrinfo) {