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

Under GCC 11.4, new warning is raised (-Wodr) #34

Open
anyzelman opened this issue Nov 21, 2024 · 1 comment
Open

Under GCC 11.4, new warning is raised (-Wodr) #34

anyzelman opened this issue Nov 21, 2024 · 1 comment

Comments

@anyzelman
Copy link
Member

This seems due to the "double-include trick" used by the hybrid backend:

/home/yzelman/lpf.github/src/MPI/ibverbs.hpp:48:21: warning: type ‘struct IBVerbs’ violates the C++ One Definition Rule [-Wodr]
   48 | class _LPFLIB_LOCAL IBVerbs
      |                     ^
/home/yzelman/lpf.github/src/MPI/ibverbs.hpp:48:21: note: a different type is defined in another translation unit
   48 | class _LPFLIB_LOCAL IBVerbs
      |                     ^
/home/yzelman/lpf.github/src/MPI/ibverbs.hpp:128:34: note: the first difference of corresponding definitions is field ‘m_activePeers’
  128 |     SparseSet< pid_t >           m_activePeers; //
      |                                  ^
/home/yzelman/lpf.github/src/MPI/ibverbs.hpp:128:34: note: a field of same name but different type is defined in another translation unit
  128 |     SparseSet< pid_t >           m_activePeers; //
      |                                  ^
/home/yzelman/lpf.github/src/common/sparseset.hpp:35:7: note: type name ‘lpf::SparseSet<int>’ should match type name ‘lpf::SparseSet<unsigned int>’
   35 | class SparseSet
      |       ^
/home/yzelman/lpf.github/src/MPI/mesgqueue.hpp:42:21: warning: type ‘struct MessageQueue’ violates the C++ One Definition Rule [-Wodr]
   42 | class _LPFLIB_LOCAL MessageQueue
      |                     ^
/home/yzelman/lpf.github/src/MPI/mesgqueue.hpp:42:21: note: a different type is defined in another translation unit
   42 | class _LPFLIB_LOCAL MessageQueue
      |                     ^
/home/yzelman/lpf.github/src/MPI/mesgqueue.hpp:136:18: note: the first difference of corresponding definitions is field ‘m_ibverbs’
  136 |     mpi::IBVerbs m_ibverbs;
      |                  ^
/home/yzelman/lpf.github/src/MPI/mesgqueue.hpp:136:18: note: a field of same name but different type is defined in another translation unit
  136 |     mpi::IBVerbs m_ibverbs;
      |                  ^
/home/yzelman/lpf.github/src/MPI/ibverbs.hpp:48:21: note: type ‘struct IBVerbs’ itself violates the C++ One Definition Rule
   48 | class _LPFLIB_LOCAL IBVerbs
      |                     ^
/home/yzelman/lpf.github/src/MPI/ibverbs.hpp:48:21: warning: type ‘struct IBVerbs’ violates the C++ One Definition Rule [-Wodr]
   48 | class _LPFLIB_LOCAL IBVerbs
      |                     ^
/home/yzelman/lpf.github/src/MPI/ibverbs.hpp:48:21: note: a different type is defined in another translation unit
   48 | class _LPFLIB_LOCAL IBVerbs
      |                     ^
/home/yzelman/lpf.github/src/MPI/ibverbs.hpp:128:34: note: the first difference of corresponding definitions is field ‘m_activePeers’
  128 |     SparseSet< pid_t >           m_activePeers; //
      |                                  ^
/home/yzelman/lpf.github/src/MPI/ibverbs.hpp:128:34: note: a field of same name but different type is defined in another translation unit
  128 |     SparseSet< pid_t >           m_activePeers; //
      |                                  ^
/home/yzelman/lpf.github/src/common/sparseset.hpp:35:7: note: type name ‘lpf::SparseSet<int>’ should match type name ‘lpf::SparseSet<unsigned int>’
   35 | class SparseSet
      |       ^
/home/yzelman/lpf.github/src/MPI/mesgqueue.hpp:42:21: warning: type ‘struct MessageQueue’ violates the C++ One Definition Rule [-Wodr]
   42 | class _LPFLIB_LOCAL MessageQueue
      |                     ^
/home/yzelman/lpf.github/src/MPI/mesgqueue.hpp:42:21: note: a different type is defined in another translation unit

We should probably look into how to name them differently and thus avoid this warning.

@anyzelman
Copy link
Member Author

Actually scratch the above intuition: this warning appears when linking

  1. liblpf_core_univ_ibverbs_Release
  2. liblpf_core_spec_ibverbs_Release
  3. liblpf_core_univ_hybrid_Release
  4. liblpf_core_spec_hybrid_Release

It seems hence related to the ibverbs engine specifically.

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

No branches or pull requests

1 participant