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

common/common.h:219:3: warning: base class ‘struct std::atomic<bool>’ should be explicitly initialized in the copy constructor [-Wextra] #1205

Closed
marxin opened this issue Feb 27, 2024 · 0 comments

Comments

@marxin
Copy link
Contributor

marxin commented Feb 27, 2024

One more warning I noticed:


                 from /home/marxin/Programming/mold/elf/gdb-index.cc:59,
                 from /home/marxin/Programming/mold/build2/elf/gdb-index.cc.X86_64.cc:3:
/home/marxin/Programming/mold/elf/../common/common.h: In instantiation of ‘mold::Atomic<T>::Atomic(const mold::Atomic<T>&) [with T = unsigned int]’:
/home/marxin/Programming/mold/elf/gdb-index.cc:142:8:   required from ‘std::pair<T*, bool> mold::ConcurrentMap<T>::insert(std::string_view, mold::u64, const T&) [with T = mold::elf::MapValue; std::string_view = std::basic_string_view<char>; mold::u64 = long unsigned int]’
/home/marxin/Programming/mold/elf/gdb-index.cc:686:43:   required from ‘void mold::elf::write_gdb_index(Context<E>&) [with E = X86_64]’
/home/marxin/Programming/mold/elf/gdb-index.cc:791:43:   required from here
/home/marxin/Programming/mold/elf/../common/common.h:219:3: warning: base class ‘struct std::atomic<unsigned int>’ should be explicitly initialized in the copy constructor [-Wextra]
  219 |   Atomic(const Atomic<T> &other) { store(other.load()); }
      |   ^~~~~~
In file included from /home/marxin/Programming/mold/elf/mold.h:4,
                 from /home/marxin/Programming/mold/elf/gdb-index.cc:59,
                 from /home/marxin/Programming/mold/build2/elf/gdb-index.cc.I386.cc:3:
@rui314 rui314 closed this as completed in 1e413d4 Feb 28, 2024
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