GNOME Bugzilla – Bug 321695
Unreachable code in xmlSwitchInputEncoding
Last modified: 2005-11-17 13:12:24 UTC
The function has two major parts - branches of the outermost IF. In the ELSE branch there is another IF with condition, which is always true, considering where it appears. Thus, a big portion of code in the ELSE part of the inner IF is effectively disabled. if (input->buf != NULL) { ... ... } else { // input->buf is NULL here! if ((input->length == 0) || (input->buf == NULL)) { ... } else { // UNREACHABLE BLOCK OF CODE } } Some compilers are smart enough to not compile unreached code (though not issuing a warning), but this fact is still worrying.
Okay, makes sense, I cleaned this up, this is commited in CVS. thanks ! Daniel