NVIDIA / egl-wayland

The EGLStream-based Wayland external platform
MIT License
275 stars 44 forks source link

error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined] #17

Closed tpgxyz closed 5 years ago

tpgxyz commented 5 years ago

I can't build egl-wayland-1.1.1 with LLVM/clang-7.0.0

FAILED: src/src@@nvidia-egl-wayland@sha/wayland-eglswap.c.o 
/usr/bin/clang -Isrc/src@@nvidia-egl-wayland@sha -Isrc -I../src -I../include -I../wayland-egl -Iwayland-eglstream -I/usr/include/EGL -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -std=gnu99 -Wall -Werror -fvisibility=hidden -Wno-pedantic -Os -gdwarf-4 -Wstrict-aliasing=2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fPIC -flto -fPIC -pthread  -MD -MQ 'src/src@@nvidia-egl-wayland@sha/wayland-eglswap.c.o' -MF 'src/src@@nvidia-egl-wayland@sha/wayland-eglswap.c.o.d' -o 'src/src@@nvidia-egl-wayland@sha/wayland-eglswap.c.o' -c ../src/wayland-eglswap.c
In file included from ../src/wayland-eglswap.c:27:
In file included from ../include/wayland-eglsurface.h:31:
../include/wayland-eglutils.h:50:5: error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined]
#if HAS_MINCORE
    ^
../include/wayland-eglutils.h:43:23: note: expanded from macro 'HAS_MINCORE'
#define HAS_MINCORE (!defined(__QNX__) && !defined(__INTEGRITY))
                      ^
../include/wayland-eglutils.h:50:5: error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined]
../include/wayland-eglutils.h:43:44: note: expanded from macro 'HAS_MINCORE'
#define HAS_MINCORE (!defined(__QNX__) && !defined(__INTEGRITY))
                                           ^
2 errors generated.

Here is the full log: http://file-store.openmandriva.org/api/v1/file_stores/86be9b6cbd6669b23d62066bfedb45f35584627a.log?show=true

mvicomoya commented 5 years ago

This should be fixed now.

@tpgxyz can you check you no longer see the error?

tpgxyz commented 5 years ago

@mvicomoya Thanks for taking a look on this. Please do not close bugs that fast. You should give a chance to bug reporter to retest potential fix.

tpgxyz commented 5 years ago

ok it's fixed