wdomirror
wdomirror copied to clipboard
fix: missing field initializer
Trying to compile the code with gcc v11.2.0
, wayland-client v1.20.0
and wayland-protocols v1.25
throws
[18/19] Compiling C object wdomirror.p/main.c.o
FAILED: wdomirror.p/main.c.o
cc -Iwdomirror.p -I. -I.. -Iprotocol -I../protocol -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O0 -g -Wno-missing-braces -Wno-unused-parameter -MD -MQ wdomirror.p/main.c.o -MF wdomirror.p/main.c.o.d -o wdomirror.p/main.c.o -c ../main.c
../main.c:415:1: error: missing initializer for field ‘configure_bounds’ of ‘const struct xdg_toplevel_listener’ [-Werror=missing-field-initializers]
415 | };
| ^
In file included from ../main.c:16:
wdomirror.p/xdg-shell-client-protocol.h:1388:16: note: ‘configure_bounds’ declared here
1388 | void (*configure_bounds)(void *data,
| ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
ninja: build stopped: subcommand failed.
I think this PR as written would cause a null pointer dereference if the server sent a configure_bounds
message.
Probably https://github.com/progandy/wdomirror/issues/5 is a better fix.
@a-m-joseph You are right. I changed the PR. Thanks!