Skip to content

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

@allsey87

Description

@allsey87

Bug report

Required Info:

  • Operating System:
    • WASI SDK (Clang 13)
  • Installation type:
    • Building from source
  • Version or commit hash:
  • DDS implementation:
    • Not applicable
  • Client library (if applicable):
    • Not applicable

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions