Words filter compiler error with GCC 4.7

Christoph Feck christoph at maxiom.de
Fri Mar 23 21:54:55 GMT 2012


Hi,

The calligra master builds fails with GCC 4.7 due to an error in the 
"hancomwords" import filter.

The loop in filters/words/hancomword/pole.cpp:869 reads:

        for (unsigned r = 0; r < header->num_mbat; r++) {
            unsigned long r = loadBigBlock(mblock, buffer2, bbat-
>blockSize);
            if (r != bbat->blockSize) {
                delete[] buffer2;
                return;
            }
            for (unsigned s = 0; s < bbat->blockSize - 4; s += 4) {
                if (k >= header->num_bat) break;
                else  blocks[k++] = readU32(buffer2 + s);
            }
            mblock = readU32(buffer2 + bbat->blockSize - 4);
        }

The error is that the variable "r" is used as the loop counter, as 
well recomputed inside the loop. This clearly is a bug, but I do not 
know the code to fix it.

Christoph Feck (kdepepo)
KDE Quality Team



More information about the calligra-devel mailing list