[Mesa-dev] [Bug 110709] g_glxglvnddispatchfuncs.c and glxglvnd.c fail to build with clang 8.0

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun May 19 13:55:14 UTC 2019


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

            Bug ID: 110709
           Summary: g_glxglvnddispatchfuncs.c and glxglvnd.c fail to build
                    with clang 8.0
           Product: Mesa
           Version: 19.1
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: GLX
          Assignee: mesa-dev at lists.freedesktop.org
          Reporter: bero at lindev.ch
        QA Contact: mesa-dev at lists.freedesktop.org

Trying to build mesa 19.1.0-rc2 with clang 8.0 results in

../src/glx/g_glxglvnddispatchfuncs.c:146:47: error: passing 'const int *' to
parameter of type 'int *' discards qualifiers
[-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    ret = (*pChooseFBConfigSGIX)(dpy, screen, attrib_list, nelements);
                                              ^~~~~~~~~~~
../src/glx/g_glxglvnddispatchfuncs.c:237:64: error: passing 'const int *' to
parameter of type 'int *' discards qualifiers
[-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    ret = (*pCreateGLXPbufferSGIX)(dpy, config, width, height, attrib_list);
                                                               ^~~~~~~~~~~
2 errors generated.


After "fixing" this by explicitly casting attrib_list to (int*), a similar
error occurs in glxglvnd.c:

../src/glx/glxglvnd.c:44:12: error: returning 'const void *const' from a
function with result type 'void *' discards qualifiers
[-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    return __glXDispatchFunctions[internalIndex];
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.


This, too, can be "fixed" with an explicit cast to void* -- but of course
that's just hiding const-ness being thrown away.

The resulting mesa works fine.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190519/333b32f6/attachment.html>


More information about the mesa-dev mailing list