Build warnings for latest 2.2 snapshot

• Mar 16, 2018 - 19:33
Type
Functional
Severity
S1 - Blocker
Status
needs info
Regression
No
Workaround
No
Project

I get these warnings building MuseScore:

/tmp/buildd/musescore-2.2~pre20180316+dfsg1/libmscore/measure.cpp: In member function 'Ms::AccidentalVal Ms::Measure::findAccidental(Ms::Segment*, int, int, bool&) const':
/tmp/buildd/musescore-2.2~pre20180316+dfsg1/libmscore/measure.cpp:407:15: warning: assuming signed overflow does not occur when assuming that (X + c) >= X is always true [-Wstrict-overflow]
 AccidentalVal Measure::findAccidental(Segment* s, int staffIdx, int line, bool &error) const
               ^~~~~~~

… and:

/tmp/buildd/musescore-2.2~pre20180316+dfsg1/libmscore/spanner.cpp: In member function 'void Ms::Spanner::setStartElement(Ms::Element*)':
/tmp/buildd/musescore-2.2~pre20180316+dfsg1/libmscore/spanner.cpp:816:61: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
             Q_ASSERT(!e || e->type() == Element::Type::NOTE);
                                                             ^
/tmp/buildd/musescore-2.2~pre20180316+dfsg1/libmscore/spanner.cpp: In member function 'void Ms::Spanner::setEndElement(Ms::Element*)':
/tmp/buildd/musescore-2.2~pre20180316+dfsg1/libmscore/spanner.cpp:829:61: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
             Q_ASSERT(!e || e->type() == Element::Type::NOTE);
                                                             ^

I just checked the whole log because I saw a rather severe one in 2.1 recently (/<>/musescore-2.1.0+dfsg3/libmscore/barline.cpp:1489:31: warning: this 'if' clause does not guard... [-Wmisleading-indentation]), but that one is fixed in 2.1, and these (plus a compiler limit hit) are all I could find left in 2.2 as of today.


Comments