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.
Created attachment 144302 [details] [review] Patch applying the workarounds mentioned in the bug description
Thanks for the patch, it helped me to build with clang 7.0.1 too. Why is this not in the release ? Do they not read their bug-tracker any more ?
We do read the bug tracker, but sometimes things slip through :) I've sent an MR with a fix here: https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1103 It will be included in the next releases (19.1.1 and 19.0.7) once it's merged.
(In reply to Eric Engestrom from comment #3) > We do read the bug tracker, but sometimes things slip through :) > > I've sent an MR with a fix here: > https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1103 > > It will be included in the next releases (19.1.1 and 19.0.7) once it's > merged. Thanks ! When Bugzilla has gone offline (while dropping spam-messages from bots beforehand on some long-ignored entries) and gitlab have disabled creation of Mesa issues I became sure that FDo Bugzilla will not be coming online at all because Mesa devs have decided to go the way of GCC which would not be surprising with things like bugs #41115 and #23705 Googling this up after failed build was a pleasant surprise.
Fixed by: commit 65b016b1469574ab2e3b4d2c2706fd96c995fa9f Author: Eric Engestrom <eric.engestrom@intel.com> Date: Fri Jun 14 15:15:10 2019 +0100 glx: fix glvnd pointer types Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110709 Fixes: 22a9e00aab66d3dd6890 ("glx: Implement the libglvnd interface.") Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.