bitshares / bitshares/bitshares-core

Compiler warnings in macOS native build

Open
#2,567 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.2k
Forks
660
Avg merge
8h 17m
Merged PRs (30d)
26

Description

Code version: develop branch (https://github.com/bitshares/bitshares-core/commit/ac1cfc058633de8cfd0355fad207e5fa6e9d65f3)
OS: macOS 11 (see https://github.com/bitshares/bitshares-core/runs/4621251504)
Boost version: 1.69
OpenSSL version: 1.1.1

>/Applications/Xcode_13.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfc.a(non_preemptable_scope_check.cpp.o) has no symbols
/Applications/Xcode_13.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfc.a(non_preemptable_scope_check.cpp.o) has no symbols

This was reported in https://github.com/bitshares/bitshares-core/issues/2340 too, should be fixed by https://github.com/bitshares/bitshares-core/pull/2660:
> In file included from /Users/runner/work/bitshares-core/bitshares-core/libraries/chain/database.cpp:30:
/Users/runner/work/bitshares-core/bitshares-core/libraries/chain/db_maint.cpp:530:27: warning: lambda capture 'witness_budget' is not used [-Wunused-lambda-capture]
modify(core, [&rec,&witness_budget,&worker_budget,&leftover_worker_funds,&dpo]
~~^~~~~~~~~~~~~~
/Users/runner/work/bitshares-core/bitshares-core/libraries/chain/db_maint.cpp:530:43: warning: lambda capture 'worker_budget' is not used [-Wunused-lambda-capture]
modify(core, [&rec,&witness_budget,&worker_budget,&leftover_worker_funds,&dpo]
~~^~~~~~~~~~~~~
/Users/runner/work/bitshares-core/bitshares-core/libraries/chain/db_maint.cpp:530:58: warning: lambda capture 'leftover_worker_funds' is not used [-Wunused-lambda-capture]
modify(core, [&rec,&witness_budget,&worker_budget,&leftover_worker_funds,&dpo]
~~^~~~~~~~~~~~~~~~~~~~~
/Users/runner/work/bitshares-core/bitshares-core/libraries/chain/db_maint.cpp:530:81: warning: lambda capture 'dpo' is not used [-Wunused-lambda-capture]
modify(core, [&rec,&witness_budget,&worker_budget,&leftover_worker_funds,&dpo]
~~^~~

About boost random generator helper:
> In file included from /Users/runner/work/bitshares-core/bitshares-core/tests/cli/main.cpp:63:
In file included from /Users/runner/work/bitshares-core/bitshares-core/tests/cli/../common/init_unit_test_suite.hpp:28:
In file included from /usr/local/opt/boost@1.69/include/boost/test/included/unit_test.hpp:22:
/usr/local/opt/boost@1.69/include/boost/test/impl/framework.ipp:763:30: warning: 'random_shuffle, const boost::unit_test::framework::state::random_generator_helper &>' is deprecated [-Wdeprecated-declarations]
std::random_shuffle( children_with_the_same_rank.begin(), children_with_the_same_rank.end(), rand_gen );
^
/Applications/Xcode_13.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/algorithm:3158:1: note: 'random_shuffle, const boost::unit_test::framework::state::random_generator_helper &>' has been explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX14 void
^
/Applications/Xcode_13.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/__config:1069:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX14'
> `# define _LIBCPP_DEPRECATED_IN_CXX14 _LIBCPP_DEPRECATED`
^
/Applications/Xcode_13.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/__config:1052:48: note: expanded from macro '_LIBCPP_DEPRECATED'
>`# define _LIBCPP_DEPRECATED __attribute__ ((deprecated))`
^

It appears when building chain_test and app_test too.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the macOS native build on the develop commit and review libraries/chain/db_maint.cpp, tests/cli/main.cpp, and the warnings from chain_test and app_test. Check the related issue 2340 and pull request 2660 before starting. Done means the reported unused-capture, ranlib, and Boost deprecation warnings are resolved or clearly isolated.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.