You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.8 KiB

  1. From cce4fa719d447c55d93458b25fa92717a2d61a60 Mon Sep 17 00:00:00 2001
  2. From: Jonas Witschel <diabonas@archlinux.org>
  3. Date: Tue, 14 Jul 2020 14:20:16 +0200
  4. Subject: [PATCH] Fix compilation with GCC 10 by providing explicit cast of
  5. _bindingCount
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. Compilation with GCC 10 fails with the following error:
  10. service/../osdep/Binder.hpp: In member function ‘void ZeroTier::Binder::refresh(ZeroTier::Phy<PHY_HANDLER_TYPE>&, unsigned int*, unsigned int, std::vector<ZeroTier::InetAddress>, INTERFACE_CHECKER&)’:
  11. service/../osdep/Binder.hpp:376:30: internal compiler error: unexpected expression ‘(std::__atomic_base<unsigned int>::__int_type)((ZeroTier::Binder*)this)->ZeroTier::Binder::_bindingCount’ of kind implicit_conv_expr
  12. 376 | _bindings[_bindingCount].udpSock = udps;
  13. | ^
  14. Help the compiler by providing an explicit cast to the appropriate type like it
  15. is already done in l. 338 of the same file.
  16. ---
  17. osdep/Binder.hpp | 6 +++---
  18. 1 file changed, 3 insertions(+), 3 deletions(-)
  19. diff --git a/osdep/Binder.hpp b/osdep/Binder.hpp
  20. index 660e6f0c..a5bc85c9 100644
  21. --- a/osdep/Binder.hpp
  22. +++ b/osdep/Binder.hpp
  23. @@ -373,9 +373,9 @@ class Binder
  24. }
  25. #endif // __LINUX__
  26. if (_bindingCount < ZT_BINDER_MAX_BINDINGS) {
  27. - _bindings[_bindingCount].udpSock = udps;
  28. - _bindings[_bindingCount].tcpListenSock = tcps;
  29. - _bindings[_bindingCount].address = ii->first;
  30. + _bindings[(unsigned int)_bindingCount].udpSock = udps;
  31. + _bindings[(unsigned int)_bindingCount].tcpListenSock = tcps;
  32. + _bindings[(unsigned int)_bindingCount].address = ii->first;
  33. phy.setIfName(udps,(char*)ii->second.c_str(),(int)ii->second.length());
  34. ++_bindingCount;
  35. }