Skip to content

Conversation

@spoonincode
Copy link
Contributor

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).

#endif
// Use instead of std::atomic when std::atomic does not support type
template <typename T>
class large_atomic {
Copy link
Contributor

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
Contributor 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

@spoonincode spoonincode deleted the interference-size-warn branch May 6, 2024 23:41
greg7mdp pushed a commit that referenced this pull request Apr 25, 2025
avoid invalid iterator dereference in `get_allocator()`
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