summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2012-09-15 00:11:31 +1000
committerMichael Cahill <michael.cahill@wiredtiger.com>2012-09-15 00:11:31 +1000
commitf8eb911314a4431882a27ead21824ae4f20173ef (patch)
treef2c5e92099e8f271e31b00f154c4512b953195c7
parent2a26957e1ea1e9b18beec289ff2f1a245d781d42 (diff)
downloadmongo-f8eb911314a4431882a27ead21824ae4f20173ef.tar.gz
lint from GCC 4.6:
lsm/lsm_cursor.c:171:2: error: 'chunk' may be used uninitialized in this function packing/packing.c:160:3: error: 'pv.u.item.size' may be used uninitialized in this function packing/packing.c:160:3: error: 'pv.u.item.data' may be used uninitialized in this function
-rw-r--r--src/lsm/lsm_cursor.c5
-rw-r--r--src/packing/packing.c1
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lsm/lsm_cursor.c b/src/lsm/lsm_cursor.c
index 10b84a317d4..e0197eac71b 100644
--- a/src/lsm/lsm_cursor.c
+++ b/src/lsm/lsm_cursor.c
@@ -117,6 +117,7 @@ __clsm_open_cursors(WT_CURSOR_LSM *clsm)
session = (WT_SESSION_IMPL *)clsm->iface.session;
lsm_tree = clsm->lsm_tree;
c = &clsm->iface;
+ chunk = NULL;
/* Copy the key, so we don't lose the cursor position. */
if (F_ISSET(c, WT_CURSTD_KEY_SET)) {
@@ -167,8 +168,8 @@ __clsm_open_cursors(WT_CURSOR_LSM *clsm)
!F_ISSET(clsm, WT_CLSM_UPDATED) ||
!F_ISSET(chunk, WT_LSM_CHUNK_ONDISK));
- clsm->primary_chunk = chunk;
- WT_ATOMIC_ADD(clsm->primary_chunk->ncursor, 1);
+ if ((clsm->primary_chunk = chunk) != NULL)
+ WT_ATOMIC_ADD(clsm->primary_chunk->ncursor, 1);
/* Peek into the btree layer to track the in-memory size. */
if (lsm_tree->memsizep == NULL)
diff --git a/src/packing/packing.c b/src/packing/packing.c
index 7f3286b2e0f..a10fbcb3c01 100644
--- a/src/packing/packing.c
+++ b/src/packing/packing.c
@@ -154,6 +154,7 @@ __wt_struct_unpackv(WT_SESSION_IMPL *session,
p = buffer;
end = p + size;
+ WT_CLEAR(pv.u.item); /* GCC 4.6 lint */
while ((ret = __pack_next(&pack, &pv)) == 0) {
WT_RET(__unpack_read(session, &pv, &p, (size_t)(end - p)));