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

silence interference-size warning #34

Closed
wants to merge 1 commit into from

Conversation

spoonincode
Copy link
Member

with gcc13 there are a deluge of warnings,

libraries/chain/include/eosio/chain/thread_utils.hpp:28:15: warning: use of ‘std::hardware_destructive_interference_size’ [-Winterference-size]
   28 |       alignas(hardware_destructive_interference_size)
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libraries/chain/include/eosio/chain/thread_utils.hpp:28:15: note: its value can vary between compiler versions or with different ‘-mtune’ or ‘-mcpu’ flags
libraries/chain/include/eosio/chain/thread_utils.hpp:28:15: note: if this use is part of a public ABI, change it to instead use a constant variable you define
libraries/chain/include/eosio/chain/thread_utils.hpp:28:15: note: the default value for the current CPU tuning is 64 bytes
libraries/chain/include/eosio/chain/thread_utils.hpp:28:15: note: you can stabilize this value with ‘--param hardware_destructive_interference_size=64’, or disable this warning with ‘-Wno-interference-size’

This is one way to silence them.

The usage of hardware_destructive_interference_size in net_plugin does not cause a warning, as the warning only is set to fire in a header (or module export).

#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Winterference-size"
#endif
// Use instead of std::atomic when std::atomic does not support type
template <typename T>
class large_atomic {
Copy link
Member

Choose a reason for hiding this comment

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

Instead why don't we just remove the alignas and the above #ifdef __cpp_lib_hardware_interference_size. If it is found useful, it can always be applied to the use of large_atomic instead of internal.

Copy link
Member Author

Choose a reason for hiding this comment

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

okay see if #41 will work

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