[reSIProcate] r4478: uninitialized variable usage
Dmitry Semyonov
dsemyonov at dins.ru
Fri Apr 29 04:38:38 CDT 2005
On Fri, 29 Apr 2005, Dmitry Semyonov wrote:
> This is obviously a bug:
>
> sip\resiprocate\helper.cxx(1007) : warning C4700:
> local variable 'index' used without having been initialized
Sorry, it is not a bug. But the warning is misleading, and the code is
a bit messy. E.g. in
if (q == preferredTokens[i]) {
if (!found || i < index) {
found = true;
index = i;
}
return(q);
}
second 'if' could be safely removed, since found and index are local
variables. Also
if (found)
return preferredTokens[index];
condition at the end of the function will never hit.
Could the author of the function review it?
TIA
--
...Bye..Dmitry.
More information about the resiprocate-devel
mailing list