ioan-chera / eureka-editor

Eureka is a cross-platform map editor for the DOOM engine games.
http://eureka-editor.sourceforge.net/
66 stars 12 forks source link

unused variable in e_path.cc #121

Closed sneakernets closed 4 months ago

sneakernets commented 2 years ago
[2/118] Building CXX object src/CMakeFiles/eurekasrc.dir/e_path.cc.o
FAILED: src/CMakeFiles/eurekasrc.dir/e_path.cc.o
/usr/bin/c++  -DBUILT_VIA_CMAKE -D_CRT_SECURE_NO_WARNINGS -I../ -I/usr/lib/fltk -I../src -Isrc -O3 -DNDEBUG   -Wall -Wextra -Werror -Wno-unused-parameter -Wno-missing-field-initializers -std=gnu++17 -MD -MT src/CMakeFiles/eurekasrc.dir/e_path.cc.o -MF src/CMakeFiles/eurekasrc.dir/e_path.cc.o.d -o src/CMakeFiles/eurekasrc.dir/e_path.cc.o -c ../src/e_path.cc
../src/e_path.cc: In member function ‘void Instance::CMD_JumpToObject()’:
../src/e_path.cc:457:13: error: unused variable ‘num’ [-Werror=unused-variable]
     for(int num : nums)
             ^~~
cc1plus: all warnings being treated as errors
ioan-chera commented 2 years ago

It was a single assert macro becoming nothing in case of release building. Hopefully fixed, but apparently I can't catch it when developing locally. I'm going to check the GitHub actions and see if I can catch it there.

ioan-chera commented 2 years ago

More problems going on:

/home/pi/Code/eureka-editor/src/w_wad.cc: In member function ‘int64_t Lump_c::getName8() const’:
/home/pi/Code/eureka-editor/src/w_wad.cc:179:9: error: ‘char* strncpy(char*, const char*, size_t)’ specified bound 8 equals destination size [-Werror=stringop-truncation]
  strncpy(buffer.cbuf, Name().c_str(), 8);
  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In member function ‘int64_t Lump_c::getName8() const’,
    inlined from ‘void Wad_file::writeToPath(const SString&) const’ at /home/pi/Code/eureka-editor/src/w_wad.cc:968:29:
/home/pi/Code/eureka-editor/src/w_wad.cc:179:9: error: ‘char* strncpy(char*, const char*, size_t)’ specified bound 8 equals destination size [-Werror=stringop-truncation]
  strncpy(buffer.cbuf, Name().c_str(), 8);
  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors