kevinkreiser/prime_server

Build failure with some compiler flags

Closed this issue · 3 comments

[  168s] /usr/bin/c++ -Dprime_server_EXPORTS -I/home/abuild/rpmbuild/BUILD/prime_server-git.20210301.bfd1534 -I/home/abuild/rpmbuild/BUILD/prime_server-git.20210301.bfd1534/prime_server -mbranch-protection=standard -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG -O2 -g -DNDEBUG -fPIC -Wall -Wextra -pedantic -Werror -std=gnu++11 -o CMakeFiles/prime_server.dir/src/zmq_helpers.cpp.o -c /home/abuild/rpmbuild/BUILD/prime_server-git.20210301.bfd1534/src/zmq_helpers.cpp
[  168s] /home/abuild/rpmbuild/BUILD/prime_server-git.20210301.bfd1534/src/zmq_helpers.cpp: In lambda function:
[  168s] /home/abuild/rpmbuild/BUILD/prime_server-git.20210301.bfd1534/src/zmq_helpers.cpp:24:10: error: unused variable 'ret' [-Werror=unused-variable]
[  168s]    24 |     auto ret = zmq_ctx_term(context);
[  168s]       |          ^~~
[  168s] /home/abuild/rpmbuild/BUILD/prime_server-git.20210301.bfd1534/src/zmq_helpers.cpp: In lambda function:
[  168s] /home/abuild/rpmbuild/BUILD/prime_server-git.20210301.bfd1534/src/zmq_helpers.cpp:40:10: error: unused variable 'ret' [-Werror=unused-variable]
[  168s]    40 |     auto ret = zmq_msg_close(message);
[  168s]       |          ^~~
[  168s] /home/abuild/rpmbuild/BUILD/prime_server-git.20210301.bfd1534/src/zmq_helpers.cpp: In lambda function:
[  168s] /home/abuild/rpmbuild/BUILD/prime_server-git.20210301.bfd1534/src/zmq_helpers.cpp:56:10: error: unused variable 'ret' [-Werror=unused-variable]
[  168s]    56 |     auto ret = zmq_msg_close(message);
[  168s]       |          ^~~
[  168s] /home/abuild/rpmbuild/BUILD/prime_server-git.20210301.bfd1534/src/zmq_helpers.cpp: In lambda function:
[  168s] /home/abuild/rpmbuild/BUILD/prime_server-git.20210301.bfd1534/src/zmq_helpers.cpp:95:10: error: unused variable 'ret' [-Werror=unused-variable]
[  168s]    95 |     auto ret = zmq_close(socket);
[  168s]       |          ^~~
[  168s] cc1plus: all warnings being treated as errors
[  168s] make[2]: *** [CMakeFiles/prime_server.dir/build.make:137: CMakeFiles/prime_server.dir/src/zmq_helpers.cpp.o] Error 1
[  168s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/prime_server-git.20210301.bfd1534/build'
[  168s] make[2]: *** Waiting for unfinished jobs....

Started happening about two weeks ago (right now build fails with the same reason, from master - pulled yesterday).

seems like CI must not be exercising the -Wall flag, thank you!

ok actually i see what was going on. turns out the default for cmake (which CI now uses) is a debug build. we do have those return codes in asserts which in debug builds actually do something, but in release builds the asserts do nothing. this makes me wonder if the autotools build is workign correclty. anyway ill fix this and check that as well.

yeah looks like autotools isnt properly taking Wall and Werror. ill fix that too..