bitshares / bitshares/bitshares-core
Compiler warnings in Ubuntu build
- Dominant language
- C++
- Stars
- 1.2k
- Forks
- 660
- Avg merge
- 8h 17m
- Merged PRs (30d)
- 26
Description
From Ubuntu 20.04 build log:
* CMake
>CMake Deprecation Warning at libraries/fc/vendor/websocketpp/CMakeLists.txt:9 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
>
> Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.
* memset
>/home/runner/work/bitshares-core/bitshares-core/libraries/fc/src/crypto/sha1.cpp: In function ‘void fc::from_variant(const fc::variant&, fc::sha1&, uint32_t)’:
/home/runner/work/bitshares-core/bitshares-core/libraries/fc/src/crypto/sha1.cpp:93:38: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class fc::sha1’; use assignment or value-initialization instead [-Wclass-memaccess]
93 | memset( &bi, char(0), sizeof(bi) );
| ^
...
/home/runner/work/bitshares-core/bitshares-core/libraries/fc/src/crypto/ripemd160.cpp: In function ‘void fc::from_variant(const fc::variant&, fc::ripemd160&, uint32_t)’:
/home/runner/work/bitshares-core/bitshares-core/libraries/fc/src/crypto/ripemd160.cpp:109:40: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class fc::ripemd160’; use assignment or value-initialization instead [-Wclass-memaccess]
109 | memset( &bi, char(0), sizeof(bi) );
| ^
...
/home/runner/work/bitshares-core/bitshares-core/libraries/fc/src/crypto/hash160.cpp: In function ‘void fc::from_variant(const fc::variant&, fc::hash160&, uint32_t)’:
/home/runner/work/bitshares-core/bitshares-core/libraries/fc/src/crypto/hash160.cpp:138:37: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class fc::hash160’; use assignment or value-initialization instead [-Wclass-memaccess]
138 | memset( &bi, char(0), sizeof(bi) );
| ^
...
/home/runner/work/bitshares-core/bitshares-core/libraries/fc/src/crypto/sha256.cpp:109:40: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class fc::sha256’; use assignment or value-initialization instead [-Wclass-memaccess]
109 | memset( &bi, char(0), sizeof(bi) );
| ^
...
/home/runner/work/bitshares-core/bitshares-core/libraries/fc/src/crypto/sha224.cpp:89:40: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class fc::sha224’; use assignment or value-initialization instead [-Wclass-memaccess]
89 | memset( &bi, char(0), sizeof(bi) );
| ^
...
/home/runner/work/bitshares-core/bitshares-core/libraries/fc/src/crypto/sha512.cpp:95:40: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class fc::sha512’; use assignment or value-initialization instead [-Wclass-memaccess]
95 | memset( &bi, char(0), sizeof(bi) );
| ^
* optional (see also: #2484)
>/home/runner/work/bitshares-core/bitshares-core/libraries/protocol/fee_schedule_calc.cpp:70:26: warning: ‘sub_asset_creation_fee’ may be used uninitialized in this function [-Wmaybe-uninitialized]
70 | optional sub_asset_creation_fee;
| ^~~~~~~~~~~~~~~~~~~~~~
...
/home/runner/work/bitshares-core/bitshares-core/tests/common/database_fixture.cpp: In member function ‘const graphene::chain::call_order_object* graphene::chain::database_fixture::borrow(const graphene::chain::account_object&, graphene::protocol::asset, graphene::protocol::asset, fc::optional)’:
/home/runner/work/bitshares-core/bitshares-core/tests/common/database_fixture.cpp:1237:32: warning: ‘*((void*)& update +64)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
1237 | call_order_update_operation update = {};
| ^~~~~~
/home/runner/work/bitshares-core/bitshares-core/tests/common/database_fixture.cpp: In member function ‘void graphene::chain::database_fixture::cover(const graphene::chain::account_object&, graphene::protocol::asset, graphene::protocol::asset, fc::optional)’:
/home/runner/work/bitshares-core/bitshares-core/tests/common/database_fixture.cpp:1262:32: warning: ‘*((void*)& update +64)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
1262 | call_order_update_operation update = {};
| ^~~~~~
...
/home/runner/work/bitshares-core/bitshares-core/libraries/wallet/wallet_transfer.cpp: In member function ‘graphene::protocol::signed_transaction graphene::wallet::detail::wallet_api_impl::borrow_asset_ext(std::string, std::string, std::string, std::string, graphene::protocol::call_order_update_operation::extensions_type, bool)’:
/home/runner/work/bitshares-core/bitshares-core/libraries/wallet/wallet_transfer.cpp:239:35: warning: ‘*((void*)& op +64)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
239 | call_order_update_operation op;
| ^~
...
In file included from /home/ubuntu/bitshares-core-dev/libraries/fc/include/fc/variant_object.hpp:2:0,
from /home/ubuntu/bitshares-core-dev/libraries/fc/include/fc/log/log_message.hpp:8,
from /home/ubuntu/bitshares-core-dev/libraries/fc/include/fc/log/logger.hpp:5,
from /home/ubuntu/bitshares-core-dev/libraries/fc/include/fc/exception/exception.hpp:6,
from /home/ubuntu/bitshares-core-dev/libraries/fc/include/fc/safe.hpp:2,
from /home/ubuntu/bitshares-core-dev/libraries/fc/include/fc/io/raw_fwd.hpp:7,
from /home/ubuntu/bitshares-core-dev/libraries/fc/include/fc/io/enum_type.hpp:3,
from /home/ubuntu/bitshares-core-dev/libraries/protocol/include/graphene/protocol/types.hpp:42,
from /home/ubuntu/bitshares-core-dev/libraries/chain/include/graphene/chain/types.hpp:26,
from /home/ubuntu/bitshares-core-dev/libraries/chain/include/graphene/chain/account_object.hpp:26,
from /home/ubuntu/bitshares-core-dev/libraries/chain/market_evaluator.cpp:24:
/home/ubuntu/bitshares-core-dev/libraries/fc/include/fc/variant.hpp: In member function ‘graphene::db::object_id_type graphene::chain::call_order_update_evaluator::do_apply(const graphene::protocol::call_order_update_operation&)’:
/home/ubuntu/bitshares-core-dev/libraries/fc/include/fc/variant.hpp:634:17: warning: ‘old_debt.fc::safe::value’ may be used uninitialized in this function [-Wmaybe-uninitialized]
to_variant( static_cast(s.value), v, max_depth );
^
/home/ubuntu/bitshares-core-dev/libraries/chain/market_evaluator.cpp:316:25: note: ‘old_debt.fc::safe::value’ was declared here
optional old_debt;
^
* boost unit_test
>In file included from /usr/include/boost/config/header_deprecated.hpp:18,
from /usr/include/boost/test/auto_unit_test.hpp:16,
from /home/runner/work/bitshares-core/bitshares-core/tests/performance/genesis_allocation.cpp:31:
/usr/include/boost/test/auto_unit_test.hpp:17:1: note: #pragma message: This header is deprecated. Use This header is deprecated. Please use instead. instead.
17 | BOOST_HEADER_DEPRECATED( "This header is deprecated. Please use instead." )
| ^~~~~~~~~~~~~~~~~~~~~~~
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the Ubuntu 20.04 build and reviewing the warnings in libraries/fc/src/crypto, libraries/protocol/fee_schedule_calc.cpp, tests/common/database_fixture.cpp, libraries/wallet/wallet_transfer.cpp, libraries/chain/market_evaluator.cpp, and tests/performance/genesis_allocation.cpp. Check the vendor/websocketpp CMakeLists.txt warning as well. Done means the listed compiler, CMake, and Boost warnings are addressed and the build remains successful.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100