2.3rc (2.2.10) does not compile on many platforms (assumes signed char)

• Jun 21, 2018 - 01:17
Reported version
2.3
Type
Functional
Severity
S2 - Critical
Status
closed
Project


In file included from /<>/musescore-2.3~pre20180620+dfsg1/libmscore/drumset.h:17:0,
from /<>/musescore-2.3~pre20180620+dfsg1/midi/midifile.cpp:17:
/<>/musescore-2.3~pre20180620+dfsg1/libmscore/tremolo.h:26:26: error: enumerator value -1 is outside the range of underlying type 'char'
INVALID_TREMOLO = -1,
^

Basically, the only valid portable “char” values are in the range 0‥127 because the platform can either have signed chars (-128‥127, like i386) or unsigned chars (0‥255, like arm64). Or specify “signed char” as data type. It’s 02:15 in the night, so I’m not trying to produce a patch here right now, especially as there are multiple ways to solve this, but see https://buildd.debian.org/status/package.php?p=musescore&suite=experime… and mind it fails on, at the very least, all kinds of ARM and PowerPC systems, (64-bit, not 31-bit) S/390 and RISC-Ⅴ right now.


Comments

Adding the GCC option -funsigned-char to CXXFLAGS during a build might just be enough to trigger this on x86 as well (especially to see whether this file is the only occurrence of this bug).

And as per the logs in Travis for arm this is the only occurence that needs mending

See e.g. https://travis-ci.org/musescore/MuseScore/jobs/394716941

There's another bad issue for arm though:
error: 'class QVector<Ms::Spanner*>' has no member named 'removeOne'
Is that due to a wrong Qt version being used or from a missing #include? removeOne() seems to come from include/QtCore/qlist.h. Or some difference between a QVector and a QList (which both should provide a removeOne(), the former since Qt 5.4, the latter since Qt 4.4)?

Patch looks good to me, I’ll test it once I get to it ($dayjob calls).

removeOne() is in qlist and qvector, but in 5.3 it’s missing in qvector and only exists in qlist; in my MuseScore backport to Debian jessie, I just patch Qt’s header adding it.

removeOne got added to QVector in Qt 5.4. Which is strange, as in CMakeLists.txt we require Qt 5.4 minimum, so the build shouldn't even start
Mind to provide a patch for that so we can can get the arm AppImage to build again?

“Build dist: trusty”

The fix is easy, you need at least xenial (16.04 LTS) for that, the Qt in trusty is too old. You probably should use bionic as base distro (18.04 LTS) nowadays though.