[Wayland-bugs] [Bug 101618] wl_array_for_each is not C++ compliant

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jun 28 06:40:18 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=101618

            Bug ID: 101618
           Summary: wl_array_for_each is not C++ compliant
           Product: Wayland
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: trivial
          Priority: medium
         Component: wayland
          Assignee: wayland-bugs at lists.freedesktop.org
          Reporter: msisov at igalia.com

Hi,

We've faced an issue, when we used wl_array_for_each in our C++ wayland client
implementation.

The problem is that one can't use wl_array_for_each(pos, array) when 
pos is passed as uint32_t*, for example, and array->data is assigned to it. In
C++, one cannot just convert void* to other pointer type implicitly as in C.

Is it possible to modify the macro defined to have explicit type cast?

#define wl_array_for_each(pos, array)   \
        for (pos = (uint32_t*) (array)->data; \

or maybe intptr_t before (array)->data ??. 

I'm not sure which one would be better, but it is to you to decide.

Br,
msisov

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-bugs/attachments/20170628/98f6fee0/attachment.html>


More information about the wayland-bugs mailing list