Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Reorder intialization to erase warning(NFC) #42

Merged
merged 1 commit into from
Jun 30, 2023

Conversation

khei4
Copy link
Contributor

@khei4 khei4 commented Jun 30, 2023

On Ubuntu 22.04, GCC warns that the initialization order doesn't match the member declaration order.

Let's erase it if it's unintentional. :)

[1/2] Building CXX object CMakeFiles/cegss.dir/main.cpp.o
In file included from /home/khei4/git/liboai/liboai/include/components/../core/network.h:18,
                 from /home/khei4/git/liboai/liboai/include/components/../core/authorization.h:19,
                 from /home/khei4/git/liboai/liboai/include/components/audio.h:14,
                 from /home/khei4/git/liboai/liboai/include/liboai.h:31,
                 from /home/khei4/git/cegss/main.cpp:7:
/home/khei4/git/liboai/liboai/include/components/../core/netimpl.h: In copy constructor ‘liboai::netimpl::components::WriteCallback::WriteCallback(const liboai::netimpl::components::WriteCallback&)’:
/home/khei4/git/liboai/liboai/include/components/../core/netimpl.h:600:98: warning: ‘liboai::netimpl::components::WriteCallback::callback’ will be initialized after [-Wreorder]
  600 |                                         std::function<bool(std::string data, intptr_t userdata)> callback;
      |                                                                                                  ^~~~~~~~
/home/khei4/git/liboai/liboai/include/components/../core/netimpl.h:599:50: warning:   ‘intptr_t liboai::netimpl::components::WriteCallback::userdata’ [-Wreorder]
  599 |                                         intptr_t userdata{};
      |  

@D7EAD D7EAD merged commit 2dbb60a into D7EAD:main Jun 30, 2023
rkorn485 added a commit to rkorn485/liboai that referenced this pull request Jul 17, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants