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

TF causing casting compiler warnings in strict mode #126

Open
davetcoleman opened this issue Jul 10, 2016 · 1 comment
Open

TF causing casting compiler warnings in strict mode #126

davetcoleman opened this issue Jul 10, 2016 · 1 comment

Comments

@davetcoleman
Copy link

Adding to my random ROS package's CMake:

add_definitions(-W -Wall -Wextra
  -Wcast-qual -Wwrite-strings -Wunreachable-code -Wpointer-arith
  -Winit-self -Wredundant-decls
  -Wno-unused-parameter -Wno-unused-function)

TF starts having lots of warnings, e.g. in /opt/ros/jade/include/tf/LinearMath/Vector3.h

/opt/ros/jade/include/tf/LinearMath/Vector3.h:626:42: warning: cast from type ‘const tfScalar* {aka const double*}’ to type ‘unsigned char*’ casts away qualifiers [-Wcast-qual]
  unsigned char* src  = (unsigned char*) &sourceVal;
                                          ^
In file included from /opt/ros/jade/include/tf2/transform_storage.h:35:0,
                 from /opt/ros/jade/include/tf2/buffer_core.h:35,
                 from /opt/ros/jade/include/tf2_ros/buffer_interface.h:35,
                 from /opt/ros/jade/include/tf2_ros/buffer.h:35,
                 from /opt/ros/jade/include/tf/tf.h:48,
@tfoote
Copy link
Member

tfoote commented Jul 11, 2016

This is doing byte ordering swapping for endianness. Its a valid warning in general but in this case it's actually correct. If you'd like to submit a PR to suppress the warnings that would be considered.

https://github.com/ros/geometry/blob/indigo-devel/tf/include/tf/LinearMath/Vector3.h#L626

Though this is a fork of the bullet linear math library and it would be better to submit the patch upstream and we can port back the changes.

https://github.com/bulletphysics/bullet3/blob/master/src/LinearMath/btVector3.h#L1231

We've had trouble in the past due to diverging from upstream when we applied patches locally that weren't accepted upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants