Description of problem: In gfdb_sqlite3.h, there's the definition: #define GF_SQL_COMPACT_DEF GF_SQL_COMPACT_INCR This makes lot of other code, which compares GF_SQL_COMPACT_DEF to other values, quite useless. For example, in gfdb_sqlite3.c, the whole switch is useless: ret = 0; switch (GF_SQL_COMPACT_DEF) { case GF_SQL_COMPACT_FULL: ret = gf_sqlite3_set_pragma(db_conn, "auto_vacuum", GF_SQL_AV_FULL); break; case GF_SQL_COMPACT_INCR: ret = gf_sqlite3_set_pragma(db_conn, "auto_vacuum", GF_SQL_AV_INCR); break; case GF_SQL_COMPACT_MANUAL: changing_pragma = _gf_false; break; default: ret = -1; gf_msg(GFDB_STR_SQLITE3, GF_LOG_ERROR, 0, LG_MSG_COMPACT_FAILED, "VACUUM type undefined"); goto out; break; } It's quite clear where it'll go. The rest is dead code. As such, the compiler complains that the initial 'ret = 0' is not needed - this value set to 'ret' is never read - which is true, as the switch goes to: ret = gf_sqlite3_set_pragma(db_conn, "auto_vacuum", GF_SQL_AV_INCR);
REVIEW: https://review.gluster.org/21500 (libglusterfs: Cleanup dead code) posted (#1) for review on master by Iraj Jamali
Also note that, this part of the code itself is completely removed now.