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

Compilation failure with clang #209

Closed
1 task done
remi-siffert-ocado opened this issue Jul 17, 2024 · 2 comments
Closed
1 task done

Compilation failure with clang #209

remi-siffert-ocado opened this issue Jul 17, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@remi-siffert-ocado
Copy link
Contributor

Affected Client Library version(s)

1.3.7

What combination of platform is the Client Library running on.

Linux

How did you install the Client Library

Build the library from source

Which robot platform is the library connected to.

URSim in docker

Robot SW / URSim version(s)

5.16.0

How are you using the Client Library

Through the robot teach pendant using External Control URCap

Issue details

Summary

The library cannot be compiled with clang because of an error in the full driver example.

Issue details

The following line in full_driver.cpp fails to compile with:

universal_robots_client_library/examples/full_driver.cpp:163:39: error: cannot pass object of non-trivial type 'std::string' (aka 'basic_string<char>') through variadic function; call will abort at runtime [-Wnon-pod-varargs] URCL_LOG_DEBUG("data_pkg:\n%s", data_pkg->toString());

Steps to Reproduce

  • Clone the repository in version 1.3.7.
  • In the cloned repository: cmake -DCMAKE_CXX_COMPILER=clang++-12 -DCMAKE_C_COMPILER=clang-12 . and make.

Expected Behavior

The library should compile successfully with gcc and clang.

Actual Behavior

The library compiles successfully with gcc but fails to compile with clang.

Workaround Suggestion

Replacing URCL_LOG_DEBUG("data_pkg:\n%s", data_pkg->toString()); with URCL_LOG_DEBUG("data_pkg:\n%s", data_pkg->toString().c_str()); does the trick.
Happy to open a PR for this.

Relevant log output

No response

Accept Public visibility

  • I agree to make this context public
@fmauch
Copy link
Collaborator

fmauch commented Jul 18, 2024

This seems fair, thank you! Would you like to provide a PR so it is attributed with you?

@fmauch fmauch added the bug Something isn't working label Jul 18, 2024
remi-siffert-ocado added a commit to remi-siffert-ocado/Universal_Robots_Client_Library that referenced this issue Jul 18, 2024
@remi-siffert-ocado
Copy link
Contributor Author

PR #210 is open for review.

@fmauch fmauch closed this as completed Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants