Compilation fails for xcursor.c
Created by: ppascher
After commit 7dffe933 I get the following warning (which is treated as an error due to default -werror=true):
ninja -C build
ninja: Entering directory `build'
[279/351] Compiling C object libwlroots.so.7.p/xcursor_xcursor.c.o
FAILED: libwlroots.so.7.p/xcursor_xcursor.c.o
cc -Ilibwlroots.so.7.p -I. -I.. -Iinclude -I../include -Iprotocol -I../protocol -I/usr/include/libdrm -I/usr/include/pixman-1 -I/usr/include/uuid -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -DWLR_USE_UNSTABLE -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wstrict-prototypes -Wimplicit-fallthrough=2 -Wendif-labels -Wstrict-aliasing=2 -Woverflow -Wmissing-prototypes -Walloca -Wno-missing-braces -Wno-missing-field-initializers -Wno-unused-parameter -fmacro-prefix-map=../= -DHAS_LIBUUID=1 '-DICONDIR="/usr/share/icons"' -fPIC -MD -MQ libwlroots.so.7.p/xcursor_xcursor.c.o -MF libwlroots.so.7.p/xcursor_xcursor.c.o.d -o libwlroots.so.7.p/xcursor_xcursor.c.o -c ../xcursor/xcursor.c
In function ‘_XcursorAddPathElt’,
inlined from ‘_XcursorBuildFullname’ at ../xcursor/xcursor.c:731:5,
inlined from ‘XcursorScanTheme’ at ../xcursor/xcursor.c:719:1:
../xcursor/xcursor.c:658:5: error: ‘strncat’ specified bound 7 equals source length [-Werror=stringop-overflow=]
658 | strncat (path + pathlen, elt, len);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘_XcursorAddPathElt’,
inlined from ‘_XcursorBuildFullname’ at ../xcursor/xcursor.c:731:5,
inlined from ‘xcursor_load_theme’ at ../xcursor/xcursor.c:719:1:
../xcursor/xcursor.c:658:5: error: ‘strncat’ specified bound 7 equals source length [-Werror=stringop-overflow=]
658 | strncat (path + pathlen, elt, len);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
[292/351] Compiling C object libwlroots.so.7.p/xwayland_xwm.c.o
ninja: build stopped: subcommand failed.
Temporary solution is to set werror=false