ValveSoftware / gamescope

SteamOS session compositing window manager
Other
3.04k stars 198 forks source link

Build error with GCC 14 (v3.14.5 & v3.14.4) #1270

Closed Algorithm0 closed 4 months ago

Algorithm0 commented 5 months ago

OS: Fedora 40 Workstation Compiler: gcc (GCC) 14.0.1 20240411 (Red Hat 14.0.1-0) Gamescope versions: 3.14.5 (6a73edd) | 3.14.4 (f2fbab6) Build commands:

git submodule update --init
meson build/
ninja -C build/

Errors:

ninja: Entering directory `build'
[374/475] Compiling C object subprojects/libliftoff/libliftoff.a.p/layer.c.o
FAILED: subprojects/libliftoff/libliftoff.a.p/layer.c.o 
cc -Isubprojects/libliftoff/libliftoff.a.p -Isubprojects/libliftoff -I../subprojects/libliftoff -I../subprojects/libliftoff/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c11 -O0 -g -Wundef -Wmissing-prototypes -Walloca -Wdeclaration-after-statement -Wfloat-conversion -Wsign-conversion -Wno-missing-braces -Wno-unused-parameter -fPIC -isystem/usr/include/libdrm -MD -MQ subprojects/libliftoff/libliftoff.a.p/layer.c.o -MF subprojects/libliftoff/libliftoff.a.p/layer.c.o.d -o subprojects/libliftoff/libliftoff.a.p/layer.c.o -c ../subprojects/libliftoff/layer.c
../subprojects/libliftoff/layer.c: В функции «liftoff_layer_create»:
../subprojects/libliftoff/layer.c:20:48: ошибка: «calloc» sizes specified with «sizeof» in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
   20 |         layer->candidate_planes = calloc(sizeof(layer->candidate_planes[0]),
      |                                                ^
../subprojects/libliftoff/layer.c:20:48: замечание: earlier argument should specify number of elements, later size of each element
cc1: все предупреждения считаются ошибками
[391/475] Compiling C++ object layer/l....so.p/VkLayer_FROG_gamescope_wsi.cpp.o
ninja: build stopped: subcommand failed.

What fixes the error:

image

Correction suggestion:

chefexperte commented 5 months ago

I had the exact same problem, that small change did fix it. Thank you a lot!

Algorithm0 commented 4 months ago

Starting with version 3.14.18, this problem is solved by updating the submodule.