FTBFS on Arch due to undefined types (include order)
Master branch fails to build on Arch.
[240/463] Compiling C object Xext/liblibxserver_xext.a.p/security.c.o
FAILED: Xext/liblibxserver_xext.a.p/security.c.o
clang -IXext/liblibxserver_xext.a.p -IXext -I../xserver/Xext -I. -I../xserver -IXi -I../xserver/Xi -Icomposite -I../xserver/composite -Idamageext -I../xserver/damageext -I../xserver/exa -Ifb -I../xserver/fb -Iglamor -I../xserver/glamor -Imi -I../xserver/mi -Imiext/damage -I../xserver/miext/damage -Imiext/shadow -I../xserver/miext/shadow -Imiext/sync -I../xserver/miext/sync -Idbe -I../xserver/dbe -Idix -I../xserver/dix -Idri3 -I../xserver/dri3 -Iinclude -I../xserver/include -Ipresent -I../xserver/present -Irandr -I../xserver/randr -Irender -I../xserver/render -Ixfixes -I../xserver/xfixes -I/usr/include/X11/dri -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -DHAVE_DIX_CONFIG_H -fno-strict-aliasing -fvisibility=hidden -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/home/koyomi/.cache/paru/clone/xorg-xwayland-git/src=/usr/src/debug/xorg-xwayland-git -flto=auto -fPIC -pthread -isystem /usr/include/bsd -DLIBBSD_OVERLAY -D_DEFAULT_SOURCE -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -MD -MQ Xext/liblibxserver_xext.a.p/security.c.o -MF Xext/liblibxserver_xext.a.p/security.c.o.d -o Xext/liblibxserver_xext.a.p/security.c.o -c ../xserver/Xext/security.c
In file included from ../xserver/Xext/security.c:31:
/usr/include/X11/extensions/securproto.h:37:5: error: unknown type name 'CARD8'
37 | CARD8 reqType;
| ^
/usr/include/X11/extensions/securproto.h:38:5: error: unknown type name 'CARD8'
38 | CARD8 securityReqType;
| ^
/usr/include/X11/extensions/securproto.h:39:5: error: unknown type name 'CARD16'
39 | CARD16 length;
| ^
/usr/include/X11/extensions/securproto.h:40:5: error: unknown type name 'CARD16'
40 | CARD16 majorVersion;
| ^
/usr/include/X11/extensions/securproto.h:41:5: error: unknown type name 'CARD16'
41 | CARD16 minorVersion;
| ^
/usr/include/X11/extensions/securproto.h:46:5: error: unknown type name 'CARD8'
46 | CARD8 type;
| ^
/usr/include/X11/extensions/securproto.h:47:5: error: unknown type name 'CARD8'
47 | CARD8 pad0;
| ^
/usr/include/X11/extensions/securproto.h:48:5: error: unknown type name 'CARD16'
48 | CARD16 sequenceNumber;
| ^
/usr/include/X11/extensions/securproto.h:49:5: error: unknown type name 'CARD32'
49 | CARD32 length;
| ^
/usr/include/X11/extensions/securproto.h:50:5: error: unknown type name 'CARD16'
50 | CARD16 majorVersion;
| ^
/usr/include/X11/extensions/securproto.h:51:5: error: unknown type name 'CARD16'
51 | CARD16 minorVersion;
| ^
/usr/include/X11/extensions/securproto.h:52:5: error: unknown type name 'CARD32'
52 | CARD32 pad1;
| ^
/usr/include/X11/extensions/securproto.h:53:5: error: unknown type name 'CARD32'
53 | CARD32 pad2;
| ^
/usr/include/X11/extensions/securproto.h:54:5: error: unknown type name 'CARD32'
54 | CARD32 pad3;
| ^
/usr/include/X11/extensions/securproto.h:55:5: error: unknown type name 'CARD32'
55 | CARD32 pad4;
| ^
/usr/include/X11/extensions/securproto.h:56:5: error: unknown type name 'CARD32'
56 | CARD32 pad5;
| ^
/usr/include/X11/extensions/securproto.h:61:5: error: unknown type name 'CARD8'
61 | CARD8 reqType;
| ^
/usr/include/X11/extensions/securproto.h:62:5: error: unknown type name 'CARD8'
62 | CARD8 securityReqType;
| ^
/usr/include/X11/extensions/securproto.h:63:5: error: unknown type name 'CARD16'
63 | CARD16 length;
| ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
This is because in b30edf32 the include of <X11/extensions/securproto.h>
in Xext/security.c
was moved up. The missing types are defined in <X11/Xdm.h>
, but this is not included directly or indirectly from securproto.h
. Before b30edf32, security.c
included "inputstr.h"
, which includes "input.h"
, which includes <X11/Xmd.h>
, before securproto.h
.
This is trivially fixed by including <X11/Xmd.h
> first. Arguably, though, it should be the responsibility of securproto.h
to include the types it uses. That file was last changed 6 years ago -- very strange that this has never come up in that time!