solarus-games / solarus

This repository was moved to GitLab: https://gitlab.com/solarus-games/solarus
http://www.solarus-games.org
Other
712 stars 133 forks source link

build error on debug mode #1055

Closed MeowSprite closed 7 years ago

MeowSprite commented 7 years ago

There are some errors when the project is built on Debug mode.

~/project/solarus/src/third_party/snes_spc/SNES_SPC.cpp: In member function ‘void SNES_SPC::cpu_write(int, int, SNES_SPC::rel_time_t)’: ~/project/solarus/src/third_party/snes_spc/SNES_SPC.cpp:437:39: error: left shift of negative value [-Werror=shift-negative-value] if ( ((~0x2F00 << (bits_in_int - 16)) << reg) < 0 ) // 36% ^ In file included from ~/project/solarus/src/third_party/snes_spc/SNES_SPC.cpp:564:0: ~/project/solarus/include/solarus/third_party/snes_spc/SPC_CPU.h: In member function ‘BOOST::uint8_t* SNES_SPC::rununtil(SNES_SPC::time_t)’: ~/project/solarus/include/solarus/third_party/snes_spc/SPC_CPU.h:298:40: error: left shift of negative value [-Werror=shift-negative-value] if ( ((~0x2F00 << (bits_in_int - 16)) << i) < 0 ) // 12%

I add a flag -Wno-error=shift-negative-value -pedantic to CMAKE_CXX_FLAGS_DEBUG, and compile success.

christopho commented 7 years ago

Fixed by 49d8b98