[Webkit-unassigned] [Bug 65414] DequeIterator lacks default constructor

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 3 02:05:35 PDT 2011


--- Comment #13 from Balazs Kelemen <kbalazs at webkit.org>  2011-10-03 02:05:35 PST ---
(In reply to comment #12)
> > Honestly I don't get it. It is coming from here:
> > 
> > DequeConstIterator<DataType*> found;
> > while (!m_killed && !timedOut && (found = m_queue.findIf(predicate)) == m_queue.end())
> >     timedOut = !m_condition.timedWait(m_mutex, absoluteTime);
> > 
> > found.m_index is uninitialized first bug the iterator is assigned before used and operator= sets the value. Maybe a compiler error?
> The default constructor of DequeConstIteratorBase doesn't initialized m_index,
> and this patch instantiates the constructor code, that causes the warning.
> You can add "m_index(0)" to the constructor definition.

It does not change the fact that it is not used (read) before it has been initialized.
The whole point is to avoid unnecessary initializations so adding "m_index(0)" is not a very good solution.
I would rather keep the current code - where callers initialize iterators with the end value - if nobody has an idea how to trick over the warning. Maybe the current patch will work when Mac will have a newer gcc.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list