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] more compiler warnings cleanup #262

Merged
merged 3 commits into from
Sep 30, 2022
Merged

[3.2] more compiler warnings cleanup #262

merged 3 commits into from
Sep 30, 2022

Conversation

linh2931
Copy link
Member

Partially resolve #254

After this PR, only 4 warnings remain in submodules abieos and libfc/libraries/ff/libff.

Most of the changes are straightforward. The following two need to be noted.

  1. For #warning directives in wasm_tests.cpp and api_tests.cpp, I created issues for them Use github issue instead of #warning directive in wasm_tests.cpp #259 and Use github issue instead of #warning directives in api_tests.cpp #260. I think this is a better way to handle TODOs. Leaving them in #warning will not get them to be done. I kept them as comments for easier identification if we decide to work on them.
  2. To resolve the warning in chain_plugin.cpp, I need to introduce a new macro FC_LOG_AND_DROP_NO_INTERPROCESS_BAD_ALLOC. The warning was
In file included from /home/lh/work/leap-main/libraries/chain/include/eosio/chain/          exceptions.hpp:3,
                 from /home/lh/work/leap-main/libraries/chain/include/eosio/chain/asset.hpp:2,
                 from /home/lh/work/leap-main/plugins/chain_plugin/include/eosio/           chain_plugin/chain_plugin.hpp:3,
                 from /home/lh/work/leap-main/plugins/chain_plugin/chain_plugin.cpp:1:
/home/lh/work/leap-main/plugins/chain_plugin/chain_plugin.cpp: In member function ‘void     eosio::chain_apis::read_write::push_block(eosio::chain_apis::read_write::                   push_block_params&&, eosio::chain_apis::next_function<eosio::chain_apis::empty>)’:
/home/lh/work/leap-main/libraries/libfc/include/fc/exception/exception.hpp:481:4: warning:  exception of type ‘boost::interprocess::bad_alloc’ will be caught
  481 |    catch( const boost::interprocess::bad_alloc& ) {\
      |    ^~~~~
/home/lh/work/leap-main/libraries/libfc/include/fc/exception/exception.hpp:481:4: note: in  definition of macro ‘FC_LOG_AND_DROP’
  481 |    catch( const boost::interprocess::bad_alloc& ) {\
      |    ^~~~~
/home/lh/work/leap-main/plugins/chain_plugin/chain_plugin.cpp:2169:6: warning:    by        earlier handler for ‘boost::interprocess::bad_alloc’
 2169 |    } catch ( boost::interprocess::bad_alloc& ) {
      |      ^~~~~

@@ -88,6 +88,8 @@ struct webauthn_json_handler : public rapidjson::BaseReaderHandler<rapidjson::UT
return true;
case IN_NESTED_CONTAINER:
return true;
default:
FC_THROW_EXCEPTION( exception, "String: current_state (${current_statea}) out of bound", ("current_state", current_state) );
Copy link
Member

@heifner heifner Sep 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should make any of these changes to elliptic_webauthn.cpp. I'm concerned there is a potential consensus difference here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also silence the warning with __builtin_unreachable at the end of the function, I believe. As-is, if it makes it to the end of the function it's pretty much UB anyways 🤷

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I will do an elog and then call __builtin_unreachable at the end of the function.

…urpress warning in elliptic_webauthn.cpp to aviod potentially breaking consensus
@linh2931 linh2931 merged commit ced3542 into main Sep 30, 2022
@linh2931 linh2931 deleted the fix_warnings branch September 30, 2022 00:52
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.

Clean up remaining 22 warnings in Leap build
3 participants