-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.2] grab bag of warning fixes #743
Conversation
unittests/eosio.token_tests.cpp
Outdated
@@ -177,7 +177,7 @@ BOOST_FIXTURE_TEST_CASE( create_max_decimals, eosio_token_tester ) try { | |||
share_type amount = 0x8ac7230489e80000L; | |||
static_assert(sizeof(share_type) <= sizeof(asset), "asset changed so test is no longer valid"); | |||
static_assert(std::is_trivially_copyable<asset>::value, "asset is not trivially copyable"); | |||
memcpy(&max, &amount, sizeof(share_type)); // hack in an invalid amount | |||
memcpy((char*)&max, &amount, sizeof(share_type)); // hack in an invalid amount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were copying an object of non-trivial type
warnings. Gnarly fix but, well, comment says it's a hack 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this fix for now, so the other clearly correct ones can be fast pathed in
@@ -490,7 +490,7 @@ BOOST_AUTO_TEST_CASE(test_deltas_resources_history) { | |||
|
|||
std::multiset<std::string> expected_contract_row_table_names {"abihash", "abihash", "hashobjs", "hashobjs", "hashobjs", "numobjs", "numobjs", "numobjs"}; | |||
|
|||
std::multiset<uint64_t> expected_contract_row_table_primary_keys {6138663577826885632,14605619288908759040, 0, 1 ,2, 0, 1, 2}; | |||
std::multiset<uint64_t> expected_contract_row_table_primary_keys {6138663577826885632U,14605619288908759040U, 0, 1 ,2, 0, 1, 2}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
integer constant is so large that it is unsigned
Most of these are to fix
comparison of integer expressions of different signedness
by replacingint
withsize_t
for comparison againstvector<>::size()
unless otherwise noted