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

Fix unique_ptr type #124

Merged
merged 1 commit into from
Oct 13, 2022
Merged

Conversation

RobertWilbrandt
Copy link
Collaborator

gcc 12 warns about this:

In file included from /usr/include/c++/12/memory:76,
                 from /home/wilbrandt/FZI/robot_folders/checkout/ur_humble/colcon_ws/src/Universal_Robots_Client_Library/include/ur_client_library/log.h:21,
                 from /home/wilbrandt/FZI/robot_folders/checkout/ur_humble/colcon_ws/src/Universal_Robots_Client_Library/src/log.cpp:31:
In member function ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = char]’,
    inlined from ‘void std::__uniq_ptr_impl<_Tp, _Dp>::reset(pointer) [with _Tp = char; _Dp = std::default_delete<char>]’ at /usr/include/c++/12/bits/unique_ptr.h:203:16,
    inlined from ‘void std::unique_ptr<_Tp, _Dp>::reset(pointer) [with _Tp = char; _Dp = std::default_delete<char>]’ at /usr/include/c++/12/bits/unique_ptr.h:501:12,
    inlined from ‘void urcl::log(const char*, int, LogLevel, const char*, ...)’ at /home/wilbrandt/FZI/robot_folders/checkout/ur_humble/colcon_ws/src/Universal_Robots_Client_Library/src/log.cpp:124:19:
/usr/include/c++/12/bits/unique_ptr.h:95:9: warning: ‘void operator delete(void*, std::size_t)’ called on pointer returned from a mismatched allocation function [-Wmismatched-new-delete]
   95 |         delete __ptr;
      |         ^~~~~~~~~~~~
/home/wilbrandt/FZI/robot_folders/checkout/ur_humble/colcon_ws/src/Universal_Robots_Client_Library/src/log.cpp: In function ‘void urcl::log(const char*, int, LogLevel, const char*, ...)’:
/home/wilbrandt/FZI/robot_folders/checkout/ur_humble/colcon_ws/src/Universal_Robots_Client_Library/src/log.cpp:112:38: note: returned from ‘void* operator new [](std::size_t)’
  112 |     buffer.reset(new char[buffer_size]);
      |

@codecov
Copy link

codecov bot commented Oct 12, 2022

Codecov Report

Base: 51.23% // Head: 51.19% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (409bca1) compared to base (cd6f4a7).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #124      +/-   ##
==========================================
- Coverage   51.23%   51.19%   -0.04%     
==========================================
  Files          82       82              
  Lines        2467     2465       -2     
  Branches      279      278       -1     
==========================================
- Hits         1264     1262       -2     
- Misses       1072     1073       +1     
+ Partials      131      130       -1     
Impacted Files Coverage Δ
src/log.cpp 55.81% <100.00%> (ø)
include/ur_client_library/queue/atomicops.h 50.00% <0.00%> (-3.34%) ⬇️
tests/test_tcp_server.cpp 99.23% <0.00%> (+0.75%) ⬆️
include/ur_client_library/comm/producer.h 40.00% <0.00%> (+1.90%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@fmauch fmauch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable, tested and it works.

@fmauch fmauch merged commit 1d9b975 into UniversalRobots:master Oct 13, 2022
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.

None yet

2 participants