Build warnings on Linux (strict-overflow in sc + unused variable in vcl)

julien2412 serval2412 at
Tue May 10 19:36:33 UTC 2016


On pc Debianx86-64 with master sources, I've got this error:
/home/julien/lo/libreoffice/sc/source/core/data/markmulti.cxx: In member
function ‘void ScMultiSel::SetMarkArea(SCCOL, SCCOL, SCROW, SCROW, bool)’:
/home/julien/lo/libreoffice/sc/source/core/data/markmulti.cxx:242:50: error:
assuming signed overflow does not occur when assuming that (X + c) >= X is
always true [-Werror=strict-overflow]
             while ( nBeg != MAXROWCOUNT && nLast < nEndRow )
cc1plus: all warnings being treated as errors

Searching on Opengrok, here are their type:
SCROW nBeg, nLast = nEndRow + 1; (see
void ScMultiSel::SetMarkArea( SCCOL nStartCol, SCCOL nEndCol, SCROW
nStartRow, SCROW nEndRow, bool bMark ) (line 206 of same file)

Other warning I got is:
/home/julien/lo/libreoffice/vcl/unx/gtk/gtksalmenu.cxx: In function
‘MenuAndId {anonymous}::decode_command(const gchar*)’:
/home/julien/lo/libreoffice/vcl/unx/gtk/gtksalmenu.cxx:892:17: error: unused
variable ‘sWindow’ [-Werror=unused-variable]
         OString sWindow = sCommand.getToken(0, '-', nIndex);
Indeed sWindow is only used in line 898:
assert(sWindow == "window" && pSalSubMenu);

Of course, I could remove --enable-werror but would like to know how to fix
these warnings properly.

Any thoughts?


View this message in context:
Sent from the Dev mailing list archive at

More information about the LibreOffice mailing list