Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #9831 from EOSIO/fix-compiler-warnings
Browse files Browse the repository at this point in the history
Fix or inhibit various compiler warnings while building on clang.
  • Loading branch information
Timothy Banks authored Jan 5, 2021
2 parents eeea8f9 + 5631513 commit ae1800b
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 21 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}
endif()

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
endif()

if ("${CMAKE_GENERATOR}" STREQUAL "Ninja")
Expand Down
10 changes: 10 additions & 0 deletions libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ endif()

add_subdirectory( fc )
add_subdirectory( builtins )

# Suppress warnings on 3rdParty Library
add_definitions( -w )
add_subdirectory( softfloat )
remove_definitions( -w )

add_subdirectory( chainbase )
add_subdirectory( wasm-jit )
add_subdirectory( appbase )
Expand All @@ -24,7 +29,12 @@ add_subdirectory( testing )
add_subdirectory( version )
add_subdirectory( state_history )
add_subdirectory( abieos )

# Suppress warnings on 3rdParty Library
add_definitions( -w )
add_subdirectory( rocksdb )
remove_definitions( -w )

add_subdirectory( chain_kv )
add_subdirectory( se-helpers )

Expand Down
2 changes: 1 addition & 1 deletion libraries/abieos
1 change: 0 additions & 1 deletion libraries/chain/include/eosio/chain/apply_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ class apply_context {
int db_upperbound_i64_chainbase( name code, name scope, name table, uint64_t id );
int db_end_i64_chainbase( name code, name scope, name table );

# warning look into if we can make any of the db_** methods and idx***'s methods const and provide a const interface
backing_store::db_context& db_get_context();

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ namespace eosio { namespace chain { namespace backing_store {
set_value(db_key_value_format::create_full_key(new_secondary_keys.secondary_key, parent.receiver), helper.value(secondary, payer));

// store the new primary to secondary key
#warning currently using useless_value to distinguish between no key and no value, eventually will just store empty value
set_value(db_key_value_format::create_full_key(new_secondary_keys.primary_to_secondary_key, parent.receiver), useless_value);
}
else {
Expand Down
2 changes: 1 addition & 1 deletion libraries/chainbase
2 changes: 1 addition & 1 deletion libraries/eos-vm
Submodule eos-vm updated 1 files
+3 −0 CMakeLists.txt
2 changes: 1 addition & 1 deletion libraries/fc
Submodule fc updated 2 files
+3 −0 CMakeLists.txt
+6 −0 src/crypto/crc.cpp
3 changes: 3 additions & 0 deletions plugins/blockvault_client_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
find_package(PkgConfig REQUIRED)

set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)

add_library( blockvault_client_plugin
blockvault_client_plugin.cpp)
target_link_libraries( blockvault_client_plugin appbase eosio_chain)
Expand Down
3 changes: 3 additions & 0 deletions plugins/blockvault_client_plugin/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)

add_executable(blockvault_unittests main.cpp postgres_backend_tests.cpp compressor_test.cpp)
target_link_libraries(blockvault_unittests blockvault Boost::unit_test_framework)

Expand Down
3 changes: 3 additions & 0 deletions plugins/resource_monitor_plugin/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)

add_executable( test_threshold test_threshold.cpp )
target_link_libraries( test_threshold resource_monitor_plugin )
target_include_directories( test_threshold PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
Expand Down
9 changes: 0 additions & 9 deletions unittests/api_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,6 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(checktime_fail_tests, TESTER_T, backing_store_ts)
t.control->get_resource_limits_manager().get_account_limits( "testapi"_n, x, net, cpu );
wdump((net)(cpu));

#warning TODO call the contract before testing to cache it, and validate that it was cached

BOOST_CHECK_EXCEPTION( call_test( t, test_api_action<TEST_METHOD("test_checktime", "checktime_failure")>{},
5000, 200, fc::raw::pack(10000000000000000000ULL) ),
deadline_exception, is_deadline_exception );
Expand Down Expand Up @@ -1056,8 +1054,6 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(checktime_intrinsic, TESTER_T, backing_store_ts) {
5000, 10 ),
deadline_exception, is_deadline_exception );

#warning TODO validate that the contract was successfully cached

//it will always call
BOOST_CHECK_EXCEPTION( call_test( t, test_api_action<TEST_METHOD("doesn't matter", "doesn't matter")>{},
5000, 10 ),
Expand Down Expand Up @@ -1094,8 +1090,6 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(checktime_grow_memory, TESTER_T, backing_store_ts)
5000, 10 ),
deadline_exception, is_deadline_exception );

#warning TODO validate that the contract was successfully cached

//it will always call
BOOST_CHECK_EXCEPTION( call_test( t, test_api_action<TEST_METHOD("doesn't matter", "doesn't matter")>{},
5000, 10 ),
Expand All @@ -1115,8 +1109,6 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(checktime_hashing_fail, TESTER_T, backing_store_ts
5000, 3 ),
deadline_exception, is_deadline_exception );

#warning TODO validate that the contract was successfully cached

//the contract should be cached, now we should get deadline_exception because of calls to checktime() from hashing function
BOOST_CHECK_EXCEPTION( call_test( t, test_api_action<TEST_METHOD("test_checktime", "checktime_sha1_failure")>{},
5000, 3 ),
Expand Down Expand Up @@ -2628,7 +2620,6 @@ BOOST_FIXTURE_TEST_CASE(types_tests, TESTER) { try {
/*************************************************************************************
* permission_tests test case
*************************************************************************************/
#warning should test with rocksdb, but accesses chainbase directly
BOOST_FIXTURE_TEST_CASE(permission_tests, TESTER) { try {
produce_blocks(1);
create_account( "testapi"_n );
Expand Down
4 changes: 0 additions & 4 deletions unittests/snapshot_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@ void exhaustive_snapshot(const eosio::chain::backing_store_type main_store,
chain.set_abi("snapshot"_n, contracts::snapshot_test_abi().data());
chain.produce_blocks(1);

#warning add a snapshot2 account and send the action against it as well, so that we are actually walking through more than just one contract's data'

// increment the test contract
chain.push_action("snapshot"_n, "increment"_n, "snapshot"_n, mutable_variant_object()
( "value", 1 )
Expand Down Expand Up @@ -679,8 +677,6 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_kv_snapshot, SNAPSHOT_SUITE, snapshot_suites)
// produce block
auto new_block = chain.produce_block();

#warning TODO: adding verification of the kv_object content and storing more than one key so that snapshot looping is tested

// undo the auto-pending from tester
chain.control->abort_block();

Expand Down
1 change: 0 additions & 1 deletion unittests/wasm_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ FC_REFLECT_EMPTY(provereset);

BOOST_AUTO_TEST_SUITE(wasm_tests)

#warning Change this back to using TESTER
struct old_wasm_tester : tester {
old_wasm_tester() : tester{setup_policy::old_wasm_parser} {}
};
Expand Down

0 comments on commit ae1800b

Please sign in to comment.