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

Changes from building cleanly on Fedora with GCC 14.2 #1975

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

kiilerix
Copy link

@kiilerix kiilerix commented Sep 7, 2024

No description provided.

Building ola fails on Fedora with GCC-14:

In file included from ./include/ola/Clock.h:32:
./include/ola/base/Macro.h:45:11: error: template-id not allowed for constructor in C++20 [-Werror=template-id-cdtor]
   45 |   TypeName(const TypeName&);               \
      |           ^
./include/ola/thread/FuturePrivate.h:92:3: note: in expansion of macro 'DISALLOW_COPY_AND_ASSIGN'
   92 |   DISALLOW_COPY_AND_ASSIGN(FutureImpl<T>);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~
./include/ola/base/Macro.h:45:11: note: remove the '< >'
   45 |   TypeName(const TypeName&);               \
      |           ^

When a class already is templatified, the templification can't be
repeated on contained methods.
This will be needed when we start using unique_ptr instead of deprecated
auto_ptr:

plugins/usbpro/DmxTriWidget.cpp: In member function 'void ola::plugin::usbpro::DmxTriWidgetImpl::HandleRawRDMResponse(uint8_t, const uint8_t*, unsigned int)':
plugins/usbpro/DmxTriWidget.cpp:652:55: error: use of deleted function 'std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = ola::rdm::RDMRequest; _Dp = std::default_delete<ola::rdm::RDMRequest>]'
  652 |   unique_ptr<RDMRequest> request(m_pending_rdm_request);
      |                                                       ^
In file included from /usr/include/c++/14/memory:78,
                 from plugins/usbpro/DmxTriWidget.cpp:23:
/usr/include/c++/14/bits/unique_ptr.h:516:7: note: declared here
  516 |       unique_ptr(const unique_ptr&) = delete;
      |       ^~~~~~~~~~
This will be needed when we start using unique_ptr instead of deprecated
auto_ptr:

libs/acn/TCPTransport.cpp:319:7: error: call of overloaded 'unique_ptr(NULL)' is ambiguous
  319 |     : m_transport(NULL) {
      |       ^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/memory:78,
                 from ./libs/acn/TCPTransport.h:34,
                 from libs/acn/TCPTransport.cpp:28:
/usr/include/c++/14/bits/unique_ptr.h:353:19: note: candidate: 'constexpr std::unique_ptr<_Tp, _Dp>::unique_ptr(std::nullptr_t) [with _Del = std::default_delete<ola::acn::IncomingStreamTransport>; <template-parameter-2-2> = void; _Tp = ola::acn::IncomingStreamTransport; _Dp = std::default_delete<ola::acn::IncomingStreamTransport>; std::nullptr_t = std::nullptr_t]'
  353 |         constexpr unique_ptr(nullptr_t) noexcept
      |                   ^~~~~~~~~~

This is only fixing up NULL usage where the compiler failed.
Address warning when compiling on Fedora with gcc-14.2:

In file included from ./include/ola/rdm/RDMControllerInterface.h:34,
                 from ./include/ola/rdm/MovingLightResponder.h:32,
                 from common/rdm/MovingLightResponder.cpp:31:
./include/ola/rdm/RDMReply.h:147:8: warning: 'template<class> class std::auto_ptr' is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations]
  147 |   std::auto_ptr<RDMResponse> m_response;
      |        ^~~~~~~~
In file included from /usr/include/c++/14/memory:78,
                 from ./include/ola/rdm/RDMReply.h:30:
/usr/include/c++/14/bits/unique_ptr.h:59:28: note: declared here
   59 |   template<typename> class auto_ptr;
      |                            ^~~~~~~~

unique_ptr was introduced in C++11.
@DaAwesomeP
Copy link
Member

Related to #1889 and #1890

@kiilerix
Copy link
Author

kiilerix commented Sep 7, 2024

Related to #1889 and #1890

Right, thanks. I had not checked for existing pending PRs. It seems like things stopped moving :-(

@DaAwesomeP
Copy link
Member

@peternewman I understand your concerns for backward compatibility, but we really need to address these couple of PRs (#1889 and #1890). auto_ptr was deprecated in C++11 and removed in C++17. Surely we could at least merge them to the master branch instead of 0.10?

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.

3 participants