We must always initialize all the non static members of the RangeIteratorLL
class in the constructor.
Below is the warning reported by coverity:
*** CID 169606: Uninitialized members (UNINIT_CTOR)
/ep-engine/src/linked_list.cc: 430 in BasicLinkedList::RangeIteratorLL::RangeIteratorLL(BasicLinkedList&)()
424 std::lock_guard<std::mutex> listWriteLg(list.getListWriteLock());
425 std::lock_guard<SpinLock> lh(list.rangeLock);
426 if (list.highSeqno < 1) {
427 /* No need of holding a lock for the snapshot as there are no items;
428 Also iterator range is at default (0, 0) */
429 readLockHolder.unlock();
CID 169606: Uninitialized members (UNINIT_CTOR)
Non-static class member "earlySnapShotEndSeqno" is not initialized in this constructor nor in any functions that it calls.
430 return;
431 }
432
433 /* Iterator to the beginning of linked list */
434 currIt = list.seqList.begin();
Change-Id: Ie3e26d685159e24054ad94d8f04bc455c8e3c4f2
Reviewed-on: http://review.couchbase.org/78425
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
: list(ll),
readLockHolder(list.rangeReadLock),
itrRange(0, 0),
- numRemaining(0) {
+ numRemaining(0),
+ earlySnapShotEndSeqno(0) {
std::lock_guard<std::mutex> listWriteLg(list.getListWriteLock());
std::lock_guard<SpinLock> lh(list.rangeLock);
if (list.highSeqno < 1) {