andrewtweber / umoria-color

Moria: a roguelike Dungeon Crawler game | Umoria - now with COLOR!
https://andrew.cool/moria
GNU General Public License v3.0
18 stars 4 forks source link

snprintf version doesn't compile for me #12

Open Eli-the-Bearded opened 1 year ago

Eli-the-Bearded commented 1 year ago

If I go back one commit to c7f0826, I can compile the game and run the game (but I don't see any colors). The current version at 5e75295b5 gets about a third of the way through compile before the snprintf() truncation warnings (all warnings treated as errors here) start to kick in. First one is:

src/dungeon_los.cpp:526:47: error: ‘%s’ directive output may be truncated writing up to 159 bytes into a region of size between 149 and 152 [-Werror=format-truncation=]
  526 |                 (void) snprintf(msg, 160, "%s %s ---pause---", description, obj_string);
call-cc commented 1 year ago

I get the same. I'm using Ubuntu 22.04 LTS with g++:

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/11/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
call-cc commented 1 year ago

If I go back one commit to c7f0826, I can compile the game and run the game (but I don't see any colors).

Try setting the terminal to 'xterm-256color', that fixed the color issue for me.