ros2 / rcl_interfaces

A repository for messages and services used by the ROS client libraries
Apache License 2.0
40 stars 43 forks source link

Warning: offset of on non-standard-layout type #135

Open allsey87 opened 2 years ago

allsey87 commented 2 years ago

Bug report

Required Info:

Steps to reproduce issue

Perhaps this is specific to WASI's libc, but when I compile test_msgs I am getting 7 warnings from w_strings__type_support.cpp about invalid offsets. For example:

test_msgs/rosidl_typesupport_introspection_cpp/test_msgs/msg/detail/w_strings__type_support.cpp:123:5: warning: offset of on non-standard-layout type 'test_msgs::msg::WStrings' (aka 'WStrings_<std::allocator<void>>') [-Winvalid-offsetof]
    offsetof(test_msgs::msg::WStrings, wstring_value),  // bytes offset in struct
    ^                                  ~~~~~~~~~~~~~
/opt/wasi-sdk/lib/clang/13.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
                       ^                     ~

Expected behavior

No warnings should be produced during compilation.

Actual behavior

The above warning appears 7 times