Skip to content

Fix build fail on gcc 14

Wujian Sun requested to merge wujiansun/demos:fix-build-fail-on-GCC-14 into main

Fix build fail on Gcc 14, here is the error log:

| ../mesa-demos-8.5.0/src/egl/opengl/eglkms.c: In function 'main':
| ../mesa-demos-8.5.0/src/egl/opengl/eglkms.c:190:24: error: passing argument 1 of 'eglGetDisplay' from incompatible pointer type [-Wincompatible-pointer-types]
|   190 |    dpy = eglGetDisplay(gbm);
|       |                        ^~~
|       |                        |
|       |                        struct gbm_device *
| In file included from ../mesa-demos-8.5.0/src/egl/opengl/eglkms.c:33:
| /home/sunwujian/code/yocto_styhead/build-imx8mpevk-xwayland/tmp/work/armv8a-mx8mp-poky-linux/mesa-demos/8.5.0/recipe-sysroot/usr/include/EGL/egl.h:143:67: note: expected 'EGLNativeDisplayType' {aka 'struct wl_display *'} but argument is of type 'struct gbm_device *'
|   143 | EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay (EGLNativeDisplayType display_id);
|       |                                              ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
| ../mesa-demos-8.5.0/src/egl/opengl/eglkms.c:229:50: error: passing argument 3 of 'eglCreateWindowSurface' from incompatible pointer type [-Wincompatible-pointer-types]
|   229 |    surface = eglCreateWindowSurface(dpy, config, gs, NULL);
|       |                                                  ^~
|       |                                                  |
|       |                                                  struct gbm_surface *
| /home/sunwujian/code/yocto_styhead/build-imx8mpevk-xwayland/tmp/work/armv8a-mx8mp-poky-linux/mesa-demos/8.5.0/recipe-sysroot/usr/include/EGL/egl.h:136:109: note: expected 'EGLNativeWindowType' {aka 'struct wl_egl_window *'} but argument is of type 'struct gbm_surface *'
|   136 | EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list);
|       |                         
```                                                                ~~~~~~~~~~~~~~~~~~~~^~~
Edited by Wujian Sun

Merge request reports

Loading