Skip to content
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

Merged
merged 2 commits into from
Aug 6, 2022
Merged

[3.2] grab bag of warning fixes #743

merged 2 commits into from
Aug 6, 2022

Conversation

spoonincode
Copy link
Member

Most of these are to fix comparison of integer expressions of different signedness by replacing int with size_t for comparison against vector<>::size() unless otherwise noted

@@ -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
Copy link
Member Author

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 😉

Copy link
Member Author

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};
Copy link
Member Author

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

@spoonincode spoonincode merged commit 85a47ed into main Aug 6, 2022
@spoonincode spoonincode deleted the warning_grab_bag branch August 6, 2022 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants