Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

fix: missing field initializer #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ubavic
Copy link

@ubavic ubavic commented May 6, 2022

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.

@ghost
Copy link

ghost commented May 11, 2022

I think this PR as written would cause a null pointer dereference if the server sent a configure_bounds message.

Probably #5 is a better fix.

@ubavic ubavic force-pushed the missing-initializer branch from e254c63 to 1426322 Compare May 11, 2022 08:24
@ubavic ubavic force-pushed the missing-initializer branch from 1426322 to bc16879 Compare May 11, 2022 08:26
@ubavic
Copy link
Author

ubavic commented May 11, 2022

@a-m-joseph You are right. I changed the PR. Thanks!

@ghost ghost mentioned this pull request May 11, 2022
13 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant