<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - g_glxglvnddispatchfuncs.c and glxglvnd.c fail to build with clang 8.0"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=110709">110709</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>g_glxglvnddispatchfuncs.c and glxglvnd.c fail to build with clang 8.0
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>19.1
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>GLX
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bero@lindev.ch
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>