FTBFS with now-default std=c23 + LLVM 18
Compiling latest git master
on Chimera Linux with full LLVM 18.1.8 toolchain I noticed lots of errors similar to the following:
[157/340] Compiling C object libwlroots-0.18.so.p/render_color.c.o
FAILED: libwlroots-0.18.so.p/render_color.c.o
clang -Ilibwlroots-0.18.so.p -I. -I.. -Iinclude -I../include -Iprotocol -Irender/gles2/shaders -Irender/vulkan/shaders -Ibackend/drm -I/usr/include/libdrm -I/usr/include/pixman-1 -I/usr/include/elogind -flto=thin -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c23 -D_POSIX_C_SOURCE=200809L -DWLR_USE_UNSTABLE -DWLR_LITTLE_ENDIAN=1 -DWLR_BIG_ENDIAN=0 -Wundef -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wstrict-prototypes -Wendif-labels -Wstrict-aliasing=2 -Woverflow -Wmissing-prototypes -Walloca -Wno-missing-braces -Wno-missing-field-initializers -Wno-unused-parameter -fmacro-prefix-map=../= -ffile-prefix-map=/builddir/wlroots-git-0.18.0_git20240628=. -Wformat -Werror=format-security -ftrivial-auto-var-init=zero -fstack-clash-protection -fno-omit-frame-pointer -fsanitize=signed-integer-overflow,integer-divide-by-zero -fsanitize-trap=signed-integer-overflow,integer-divide-by-zero -fno-sanitize-recover -flto=thin -O2 -g2 -fPIC -MD -MQ libwlroots-0.18.so.p/render_color.c.o -MF libwlroots-0.18.so.p/render_color.c.o.d -o libwlroots-0.18.so.p/render_color.c.o -c ../render/color.c
In file included from ../render/color.c:4:
In file included from ../include/render/color.h:5:
In file included from ../include/wlr/util/addon.h:12:
/usr/include/wayland-server-core.h:680:41: error: 'deprecated' attribute cannot be applied to types
680 | int32_t stride, uint32_t format) WL_DEPRECATED;
| ^
/usr/include/wayland-util.h:52:25: note: expanded from macro 'WL_DEPRECATED'
52 | #define WL_DEPRECATED [[deprecated]]
| ^
1 error generated.
(a more complete build log is at https://paste.c-net.org/i06bnxlxial9 if useful)
I bisected this down to the rather recent 85875c47 (from !4505 (merged)) and can confirm configuring with -Dc_std=c11
allows for a successful build again. Fwiw c17
also builds.
Edited by Jami Kettunen