Build on Fedora 35 quits on warning treated as error (pthread/thread.o)

g++ -o build/opt/third_party/boost/libs/thread/src/pthread/thread.o -c -Woverloaded-virtual -Wpessimizing-move -Wno-maybe-uninitialized -fsized-deallocation -std=c++17 -Wno-overloaded-v
irtual -Werror -fasynchronous-unwind-tables -ggdb -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -fno-omit-frame-pointer -fno-strict-aliasing -O2 -march=sandybridge -mtune=gene
ric -mprefer-vector-width=128 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-const-variable -Wno-unused-but-set-variable -Wno-missing-braces -f
stack-protector-strong -Wa,--nocompress-debug-sections -fno-builtin-memcmp -fPIE -DPCRE_STATIC -DNDEBUG -D_XOPEN_SOURCE=700 -D_GNU_SOURCE -D_FORTIFY_SOURCE=2 -DBOOST_THREAD_VERSION=5 -D
BOOST_THREAD_USES_DATETIME -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS -DBOOST_ENABLE_ASSERT_DEBUG_HANDLER -DBOOST_LOG_NO_SHORTHAND_NAMES -DBOOST_LOG_USE_NAT
IVE_SYSLOG -DBOOST_LOG_WITHOUT_THREAD_ATTR -DABSL_FORCE_ALIGNED_ACCESS -DBOOST_BIND_GLOBAL_PLACEHOLDERS -DBOOST_THREAD_BUILD_LIB -DBOOST_THREAD_PTHREAD -Isrc/third_party/boost src/third
_party/boost/libs/thread/src/pthread/thread.cpp
In file included from src/third_party/boost/boost/thread/thread_only.hpp:17,
             from src/third_party/boost/libs/thread/src/pthread/thread.cpp:11:
src/third_party/boost/boost/thread/pthread/thread_data.hpp: In member function 'void boost::thread_attributes::set_stack_size(std::size_t)':
src/third_party/boost/boost/thread/pthread/thread_data.hpp:61:19: error: comparison of integer expressions of different signedness: 'std::size_t' {aka 'long unsigned int'} and 'long int' [-Werror=sign-compare]
   61 |           if (size<PTHREAD_STACK_MIN) size=PTHREAD_STACK_MIN;
  |                   ^

… and then …

cc1plus: all warnings being treated as errors
scons: *** [build/opt/third_party/boost/libs/thread/src/pthread/thread.o] Error 1
scons: building terminated because of errors.
build/opt/third_party/boost/libs/thread/src/pthread/thread.o failed: Error 1

Hi @Jack_Woehr - This warning/error arrises from boost, which is a third party library that we vendor. We will need to wait for an upstream fix in boost in order to make the warning disappear. We do have a ticket to upgrade to the latest boost (see https://jira.mongodb.org/browse/SERVER-60440), but we have not yet checked whether the latest stable boost release addresses this particular issue. In the meantime, you can build with the --disable-warnings-as-errors flag which will stop this from being an error.

2 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.