Wohlstand / libADLMIDI

A Software MIDI Synthesizer library with OPL3 (YMF262) emulator
GNU Lesser General Public License v3.0
174 stars 17 forks source link

Builds fail on Arm #229

Closed ggardet closed 4 years ago

ggardet commented 4 years ago

Builds fail on Arm (aarch64, armv7) because char are unsigned on Arm, which leads to the following error:

[   86s] /usr/bin/c++  -DENABLE_END_SILENCE_SKIPPING -DSUPPORT_PUZZLE_GAME -DSUPPORT_VIDEO_OUTPUT -I/home/abuild/rpmbuild/BUILD/libADLMIDI-1.4.0.1-1/include -I/home/abuild/rpmbuild/BUILD/libADLMIDI-1.4.0.1-1/src  -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG -Wall -Wextra -fPIC -O2 -g -DNDEBUG   -Wl,-rpath='$ORIGIN/../lib' -fopenmp -std=gnu++11 -o CMakeFiles/adlmidi2.dir/utils/adlmidi-2/puzzlegame.cc.o -c /home/abuild/rpmbuild/BUILD/libADLMIDI-1.4.0.1-1/utils/adlmidi-2/puzzlegame.cc
[   86s] /home/abuild/rpmbuild/BUILD/libADLMIDI-1.4.0.1-1/utils/adlmidi-2/puzzlegame.cc: In member function 'int ADLMIDI_PuzzleGame::TetrisAIengine::AI_Run(const int (&)[25][18], const ADLMIDI_PuzzleGame::Piece*)':
[   86s] /home/abuild/rpmbuild/BUILD/libADLMIDI-1.4.0.1-1/utils/adlmidi-2/puzzlegame.cc:318:48: error: narrowing conversion of '-1' from 'int' to 'char' [-Wnarrowing]
[   86s]   318 |                 char full[4] = { -1, -1, -1, -1};
[   86s]       |
Wohlstand commented 4 years ago

Which GCC version you have? However, I did a fix just now.

ggardet commented 4 years ago

Which GCC version you have? However, I did a fix just now.

GCC10. But I already saw this kind of issues with older GCC on other software.

Wohlstand commented 4 years ago

Interesting... Anyway, I had the similiar error on MinGW 6/7/8 when I tried to build Qt 4.3 for Windows 98 purposes use, I had to modify the source to fix the build.

ggardet commented 4 years ago

It does fix the build issue. Thanks!

Wohlstand commented 4 years ago

:fox_face: :+1: