4.9.4 fails to build with clang 15.0.7 (arch linux)
Steps to reproduce
Attempt to build with clang
CC=clang meson build
ninja -C build
Current behavior
ninja: Entering directory `build'
[0/1] Regenerating build files.
The Meson build system
Version: 1.0.0
Source dir: /home/alex/Documents/git/gtk
Build dir: /home/alex/Documents/git/gtk/build
Build type: native build
Project name: gtk
Project version: 4.9.4
C compiler for the host machine: clang (clang 15.0.7 "clang version 15.0.7")
C linker for the host machine: clang ld.bfd 2.40
Host machine cpu family: x86_64
Host machine cpu: x86_64
Has header "crt/externs.h" : NO (cached)
Has header "dev/evdev/input.h" : NO (cached)
Has header "dlfcn.h" : YES (cached)
Has header "ftw.h" : YES (cached)
Has header "inttypes.h" : YES (cached)
Has header "linux/input.h" : YES (cached)
Has header "linux/memfd.h" : YES (cached)
Has header "locale.h" : YES (cached)
Has header "memory.h" : YES (cached)
Has header "stdint.h" : YES (cached)
Has header "stdlib.h" : YES (cached)
Has header "strings.h" : YES (cached)
Has header "string.h" : YES (cached)
Has header "sys/mman.h" : YES (cached)
Has header "sys/param.h" : YES (cached)
Has header "sys/stat.h" : YES (cached)
Has header "sys/sysinfo.h" : YES (cached)
Has header "sys/systeminfo.h" : NO (cached)
Has header "sys/time.h" : YES (cached)
Has header "sys/types.h" : YES (cached)
Has header "unistd.h" : YES (cached)
Has header "gio/gdesktopappinfo.h" : NO (cached)
Library m found: YES
Checking for function "dcgettext" with dependency -lm: YES (cached)
Checking for function "getpagesize" with dependency -lm: YES (cached)
Checking for function "getresuid" with dependency -lm: YES (cached)
Checking for function "lstat" with dependency -lm: YES (cached)
Checking for function "memfd_create" with dependency -lm: YES (cached)
Checking for function "mmap" with dependency -lm: YES (cached)
Checking for function "posix_fallocate" with dependency -lm: YES (cached)
Checking for function "_lock_file" with dependency -lm: NO (cached)
Checking for function "flockfile" with dependency -lm: YES (cached)
Checking for function "mkstemp" with dependency -lm: YES (cached)
Checking for function "mallinfo2" with dependency -lm: YES (cached)
Checking for function "sincos" with dependency -lm: YES (cached)
Checking for function "sincosf" with dependency -lm: YES (cached)
Checking if "sigsetjmp" : links: YES (cached)
Checking if "__uint128_t available" compiles: YES (cached)
Checking for function "mlock" : YES (cached)
Checking for function "madvise" : YES (cached)
Compiler for C supports arguments -fno-strict-aliasing: YES (cached)
Compiler for C supports arguments -Wno-c++11-extensions: YES (cached)
Compiler for C supports arguments -Wno-missing-include-dirs: YES (cached)
Compiler for C supports arguments -Wno-typedef-redefinition: YES (cached)
Compiler for C supports arguments -Wno-tautological-constant-out-of-range-compare: YES (cached)
Compiler for C supports arguments -Wduplicated-branches: NO (cached)
Compiler for C supports arguments -Wduplicated-cond: NO (cached)
Compiler for C supports arguments -Wformat=2: YES (cached)
Compiler for C supports arguments -Wformat-nonliteral: YES (cached)
Compiler for C supports arguments -Wformat-security: YES (cached)
Compiler for C supports arguments -Wignored-qualifiers: YES (cached)
Compiler for C supports arguments -Wimplicit-function-declaration: YES (cached)
Compiler for C supports arguments -Wlogical-op: NO (cached)
Compiler for C supports arguments -Wmisleading-indentation: YES (cached)
Compiler for C supports arguments -Wmissing-format-attribute: YES (cached)
Compiler for C supports arguments -Wmissing-include-dirs: YES (cached)
Compiler for C supports arguments -Wmissing-noreturn: YES (cached)
Compiler for C supports arguments -Wnested-externs: YES (cached)
Compiler for C supports arguments -Wold-style-definition: YES (cached)
Compiler for C supports arguments -Wpointer-arith: YES (cached)
Compiler for C supports arguments -Wshadow: YES (cached)
Compiler for C supports arguments -Wstrict-prototypes: YES (cached)
Compiler for C supports arguments -Wswitch-default: YES (cached)
Compiler for C supports arguments -Wswitch-enum: YES (cached)
Compiler for C supports arguments -Wundef: YES (cached)
Compiler for C supports arguments -Wuninitialized: YES (cached)
Compiler for C supports arguments -Wunused: YES (cached)
Compiler for C supports arguments -Werror=address: YES (cached)
Compiler for C supports arguments -Werror=array-bounds: YES (cached)
Compiler for C supports arguments -Werror=empty-body: YES (cached)
Compiler for C supports arguments -Werror=implicit: YES (cached)
Compiler for C supports arguments -Werror=implicit-fallthrough: YES (cached)
Compiler for C supports arguments -Werror=implicit-fallthrough=5: NO (cached)
Compiler for C supports arguments -Werror=init-self: YES (cached)
Compiler for C supports arguments -Werror=int-to-pointer-cast: YES (cached)
Compiler for C supports arguments -Werror=main: YES (cached)
Compiler for C supports arguments -Werror=missing-braces: YES (cached)
Compiler for C supports arguments -Werror=missing-declarations: YES (cached)
Compiler for C supports arguments -Werror=missing-prototypes: YES (cached)
Compiler for C supports arguments -Werror=nonnull: YES (cached)
Compiler for C supports arguments -Werror=pointer-to-int-cast: YES (cached)
Compiler for C supports arguments -Werror=redundant-decls: YES (cached)
Compiler for C supports arguments -Werror=return-type: YES (cached)
Compiler for C supports arguments -Werror=sequence-point: YES (cached)
Compiler for C supports arguments -Werror=trigraphs: YES (cached)
Compiler for C supports arguments -Werror=vla: YES (cached)
Compiler for C supports arguments -Werror=write-strings: YES (cached)
Compiler for C supports arguments -Wnull-dereference: YES (cached)
Compiler for C supports link arguments -Wl,-Bsymbolic: YES (cached)
Compiler for C supports link arguments -Wl,-z,relro: YES (cached)
Compiler for C supports link arguments -Wl,-z,now: YES (cached)
Dependency glib-2.0 found: YES 2.74.5 (cached)
Dependency gobject-2.0 found: YES 2.74.5 (cached)
Dependency gio-unix-2.0 found: YES 2.74.5 (cached)
Dependency gmodule-2.0 found: YES 2.74.5 (cached)
Dependency cairo found: YES 1.17.8 (cached)
Dependency cairo-gobject found: YES 1.17.8 (cached)
Dependency pango found: YES 1.50.12 (cached)
Dependency fribidi found: YES 1.0.12 (cached)
Dependency harfbuzz found: YES 6.0.0 (cached)
Dependency pangoft2 found: YES 1.50.12 (cached)
Dependency pangocairo found: YES 1.50.12 (cached)
Dependency gdk-pixbuf-2.0 found: YES 2.42.10 (cached)
Dependency libpng found: YES 1.6.39 (cached)
Dependency libtiff-4 found: YES 4.5.0 (cached)
Dependency libjpeg found: YES 2.1.4 (cached)
Dependency epoxy found: YES 1.5.10 (cached)
Dependency xkbcommon found: YES 1.5.0 (cached)
Dependency graphene-gobject-1.0 found: YES 1.10.8 (cached)
Dependency iso-codes found: YES 4.12.0 (cached)
Dependency gobject-introspection-1.0 found: YES 1.74.0 (cached)
Dependency tracker-sparql-3.0 skipped: feature tracker disabled
Dependency colord skipped: feature colord disabled
Dependency cairo-xlib found: YES 1.17.8 (cached)
Dependency cairo found: YES 1.17.8 (cached)
Dependency cairo-script-interpreter found: YES 1.17.8 (cached)
Dependency wayland-client found: YES 1.21.0 (cached)
Dependency wayland-protocols found: YES 1.31 (cached)
Dependency wayland-egl found: YES 18.1.0 (cached)
Dependency xrandr found: YES 1.5.3 (cached)
Dependency xrandr found: YES 1.5.3 (cached)
Dependency x11 found: YES 1.8.4 (cached)
Dependency xrender found: YES 0.9.11 (cached)
Dependency xi found: YES 1.8 (cached)
Dependency xext found: YES 1.3.5 (cached)
Dependency xcursor found: YES 1.2.1 (cached)
Dependency xdamage found: YES 1.1.6 (cached)
Dependency xfixes found: YES 6.0.0 (cached)
Dependency fontconfig found: YES 2.14.2 (cached)
Checking for function "XkbQueryExtension" with dependency x11: YES (cached)
Checking for function "XSyncQueryExtension" with dependency xext: YES (cached)
Checking for function "XGetEventData" with dependency x11: YES (cached)
Has header "X11/extensions/XInput2.h" with dependency xi: YES (cached)
Checking for function "XIAllowTouchEvents" with dependency xi: YES (cached)
Checking whether type "XIScrollClassInfo" has member "number" with dependency xi: YES (cached)
Checking whether type "XIGesturePinchEvent" has member "type" with dependency xi: YES (cached)
Dependency xinerama found: YES 1.1.5 (cached)
Header "X11/extensions/Xinerama.h" has symbol "XineramaQueryExtension" with dependency xinerama: YES (cached)
Checking for function "ngettext" : YES (cached)
Dependency vulkan skipped: feature vulkan disabled
Dependency cloudproviders skipped: feature cloudproviders disabled
Message: Need aligned memory due to the use of SSE2 or GCC vector instructions
Checking if "F16C intrinsics" compiles: NO (cached)
Program g-ir-scanner found: YES (/usr/bin/g-ir-scanner)
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Program gen-gdk-gresources-xml.py found: YES (/usr/bin/python /home/alex/Documents/git/gtk/gdk/gen-gdk-gresources-xml.py)
Configuring gdk.gresource.xml with command
Found pkg-config: /usr/bin/pkg-config (1.8.0)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Program glib-genmarshal found: YES (/usr/bin/glib-genmarshal)
Configuring gdkconfig.h using configuration
Configuring gdkversionmacros.h using configuration
Checking for function "shm_open" : YES (cached)
Program wayland-scanner found: YES (/usr/bin/wayland-scanner)
Program gen-gsk-gresources-xml.py found: YES (/usr/bin/python /home/alex/Documents/git/gtk/gsk/gen-gsk-gresources-xml.py)
Configuring gsk.resources.xml with command
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program gdbus-codegen found: YES (/usr/bin/gdbus-codegen)
Program gen-gtk-gresources-xml.py found: YES (/usr/bin/python /home/alex/Documents/git/gtk/gtk/gen-gtk-gresources-xml.py)
Configuring gtk.gresources.xml with command
Program sassc found: YES (/usr/bin/sassc)
Program objcopy found: YES (/usr/bin/objcopy)
Program ld found: YES (/usr/bin/ld)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring de.gresource.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring da.gresource.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring fr.gresource.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring es.gresource.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring hu.gresource.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring it.gresource.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring ko.gresource.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring lt.gresource.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring ms.gresource.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring nl.gresource.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring pl.gresource.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring pt.gresource.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring ru.gresource.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring sv.gresource.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring uk.gresource.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring zh.gresource.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program gdbus-codegen found: YES (/usr/bin/gdbus-codegen)
Program glib-genmarshal found: YES (/usr/bin/glib-genmarshal)
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Program gentypefuncs.py found: YES (/usr/bin/python /home/alex/Documents/git/gtk/gtk/gentypefuncs.py)
Program gdbus-codegen found: YES (/usr/bin/gdbus-codegen)
Configuring gtkversion.h using configuration
Dependency x11 found: YES 1.8.4 (cached)
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Has header "langinfo.h" : YES (cached)
Header "langinfo.h" has symbol "_NL_MEASUREMENT_MEASUREMENT" : YES (cached)
Header "langinfo.h" has symbol "_NL_PAPER_HEIGHT" : YES (cached)
Header "langinfo.h" has symbol "_NL_PAPER_WIDTH" : YES (cached)
Header "langinfo.h" has symbol "_NL_TIME_FIRST_WEEKDAY" : YES (cached)
Dependency cpdb-frontend skipped: feature print-cpdb disabled
Dependency cups found: YES 2.4.2 (cached)
Dependency libavfilter skipped: feature media-ffmpeg disabled
Dependency gstreamer-player-1.0 found: YES 1.22.0 (cached)
Dependency gstreamer-gl-1.0 found: YES 1.22.0 (cached)
Program ../build-aux/meson/gen-demo-header.py found: YES (/home/alex/Documents/git/gtk/demos/../build-aux/meson/gen-demo-header.py)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Dependency librsvg-2.0 found: YES 2.55.1 (cached)
Program geninclude.py found: YES (/home/alex/Documents/git/gtk/demos/gtk-demo/geninclude.py)
Program objcopy found: YES (/usr/bin/objcopy)
Program ld found: YES (/usr/bin/ld)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Configuring org.gtk.Demo4.appdata.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring org.gtk.IconBrowser4.appdata.xml using configuration
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring org.gtk.gtk4.NodeEditor.appdata.xml using configuration
Program objcopy found: YES (/usr/bin/objcopy)
Program ld found: YES (/usr/bin/ld)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring org.gtk.WidgetFactory4.appdata.xml using configuration
C++ compiler for the host machine: ccache c++ (gcc 12.2.1 "c++ (GCC) 12.2.1 20230201")
C++ linker for the host machine: c++ ld.bfd 2.40
Program make-pot found: YES (/home/alex/Documents/git/gtk/make-pot)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program bash found: YES (/usr/bin/bash)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Configuring config.h using configuration
Program msgfmt found: YES (/usr/bin/msgfmt)
Program msginit found: YES (/usr/bin/msginit)
Program msgmerge found: YES (/usr/bin/msgmerge)
Program xgettext found: YES (/usr/bin/xgettext)
Program gi-docgen found: YES (/usr/bin/gi-docgen)
Program gtk4-builder-tool found: YES (overridden)
Program rst2man found: YES (/usr/bin/rst2man)
Dependency gio-2.0 found: YES 2.74.5 (cached)
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Dependency gio-2.0 found: YES 2.74.5 (cached)
Program gio-querymodules found: YES (/usr/bin/gio-querymodules)
Dependency gio-2.0 found: YES 2.74.5 (cached)
Program gio-querymodules found: YES (/usr/bin/gio-querymodules)
Program gtk4-update-icon-cache found: YES (overridden)
Build targets in project: 582
NOTICE: Future-deprecated features used:
* 0.64.0: {'copy arg in configure_file'}
gtk 4.9.4
Display backends: wayland
x11
Print backends : cups
file
Media backends : gstreamer
Features
Vulkan support : False
Cloud support : False
Sysprof support : False
Colord support : False
Tracker support : False
Toolchain
Compiler : clang
Linker : ld.bfd
Build
Debugging : True
Optimization : 2
Introspection : False
Documentation : False
Man pages : False
Tests : True
Demos : True
Examples : True
Directories
prefix : /usr/local
includedir : /usr/local/include
libdir : /usr/local/lib
datadir : /usr/local/share
Found ninja-1.11.1 at /usr/bin/ninja
Cleaning... 3 files.
[176/1545] Compiling C object gsk/libgsk.a.p/gl_gskglrenderjob.c.o
FAILED: gsk/libgsk.a.p/gl_gskglrenderjob.c.o
clang -Igsk/libgsk.a.p -Igsk -I../gsk -I. -I.. -Igdk/x11 -I../gdk/x11 -Igdk -I../gdk -Igtk/css -I/usr/include/graphene-1.0 -I/usr/lib/graphene-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/lzo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O2 -g -DG_LOG_USE_STRUCTURED=1 -DGLIB_DISABLE_DEPRECATION_WARNINGS '-DGTK_VERSION="4.9.4"' -D_GNU_SOURCE -DG_ENABLE_DEBUG -fPIC -pthread -mfpmath=sse -msse -msse2 -DGTK_COMPILATION '-DG_LOG_DOMAIN="Gsk"' -DG_LOG_STRUCTURED=1 -fno-strict-aliasing -Wno-c++11-extensions -Wno-missing-include-dirs -Wno-typedef-redefinition -Wno-tautological-constant-out-of-range-compare -Wformat=2 -Wformat-nonliteral -Wformat-security -Wignored-qualifiers -Wimplicit-function-declaration -Wmisleading-indentation -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wuninitialized -Wunused -Werror=address -Werror=array-bounds -Werror=empty-body -Werror=implicit -Werror=implicit-fallthrough -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=missing-declarations -Werror=missing-prototypes -Werror=nonnull -Werror=pointer-to-int-cast -Werror=redundant-decls -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=vla -Werror=write-strings -Wnull-dereference -fvisibility=hidden -MD -MQ gsk/libgsk.a.p/gl_gskglrenderjob.c.o -MF gsk/libgsk.a.p/gl_gskglrenderjob.c.o.d -o gsk/libgsk.a.p/gl_gskglrenderjob.c.o -c ../gsk/gl/gskglrenderjob.c
../gsk/gl/gskglrenderjob.c:3692:7: error: expected expression
float min_x = bounds->origin.x;
^
../gsk/gl/gskglrenderjob.c:3694:21: error: use of undeclared identifier 'min_x'; did you mean 'min_y'?
float max_x = min_x + bounds->size.width;
^~~~~
min_y
../gsk/gl/gskglrenderjob.c:3693:13: note: 'min_y' declared here
float min_y = bounds->origin.y;
^
../gsk/gl/gskglrenderjob.c:3696:32: error: use of undeclared identifier 'min_x'; did you mean 'min_y'?
float scale_x = (max_x - min_x) / texture->width;
^~~~~
min_y
../gsk/gl/gskglrenderjob.c:3693:13: note: 'min_y' declared here
float min_y = bounds->origin.y;
^
../gsk/gl/gskglrenderjob.c:3721:16: error: use of undeclared identifier 'min_x'; did you mean 'min_y'?
x1 = min_x + (scale_x * slice->rect.x);
^~~~~
min_y
../gsk/gl/gskglrenderjob.c:3693:13: note: 'min_y' declared here
float min_y = bounds->origin.y;
^
4 errors generated.
[190/1545] Compiling C object gsk/libgsk.a.p/gl_gskglcommandqueue.c.o
../gsk/gl/gskglcommandqueue.c:971:9: warning: variable 'n_programs' set but not used [-Wunused-but-set-variable]
guint n_programs = 0;
^
../gsk/gl/gskglcommandqueue.c:969:9: warning: variable 'n_fbos' set but not used [-Wunused-but-set-variable]
guint n_fbos = 0;
^
2 warnings generated.
[201/1545] Compiling C object modules/printbackends/libprintbackend-cups.so.p/gtkprintbackendcups.c.o
ninja: build stopped: subcommand failed.
Expected outcome
No build failure
Version information
clang version 15.0.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
GTK 4.9.4
Additional information
No build failure with latest main, so I would suggest making a new release ASAP