Compile error -Werror=unused-variable


#1

I am trying to compile 15.12. I am using the same process I successfully used for 15.7:

run.py setup --force
run.py make -j4

During the make I get:

/usr/src/scidb-15.12.1.4cadab5/src/util/PerfTime.cpp: In function 'double scidb::perfTimeGetElapsed()':
/usr/src/scidb-15.12.1.4cadab5/src/util/PerfTime.cpp:44:14: error: unused variable 'result' [-Werror=unused-variable]
         auto result = ::gettimeofday(&tv, NULL);
              ^
/usr/src/scidb-15.12.1.4cadab5/src/util/PerfTime.cpp: In function 'double scidb::perfTimeGetCPU()':
/usr/src/scidb-15.12.1.4cadab5/src/util/PerfTime.cpp:57:14: error: unused variable 'result' [-Werror=unused-variable]
         auto result = ::getrusage(RUSAGE_THREAD, &rUsage);

It looks like something that could easily be ignored, but I’m not sure where is the bast place to do it.


#2

I was able to successfully compile 15.12 by changing:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconversion -Werror")

line to:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconversion")

in the CMakeLists.txt file.