Re: [reSIProcate] r4478: uninitialized variable usage
- From: Dmitry Semyonov <dsemyonov@xxxxxxx>
- Date: Fri, 29 Apr 2005 13:38:38 +0400 (MSD)
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.