aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Add support for the deprecated-since XML attributeSimon Ser2024-04-241-7/+47
| | | | | | | | | | | | | | This marks a request, event or enum entry as deprecated since a given version. Note that it's not clear what it means if an entry is deprecated at some version, and the enum is used from some completely different interface than where it was defined. However, that's a more general issue with enums, see: https://gitlab.freedesktop.org/wayland/wayland/-/issues/435 Signed-off-by: Simon Ser <contact@emersion.fr> References: https://gitlab.freedesktop.org/wayland/wayland/-/issues/89
* scanner: add validators for enumsSimon Ser2024-04-231-4/+32
| | | | | | | | | | | | | | Right now compositors need to manually check that enum values sent by the client are valid. In particular: - Check that the value sent by the client is not outside of the enum. - Check that the version of the enum entry is consistent with the object version. Automatically generate validator functions to perform these tasks. Signed-off-by: Simon Ser <contact@emersion.fr> Closes: https://gitlab.freedesktop.org/wayland/wayland/-/issues/104
* connection: Dynamically resize connection buffersManuel Stoeckl2024-04-086-74/+379
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using fixed size connection buffers, if either the client or the server is sending requests faster than the other end can cope with, the connection buffers will fill up, eventually killing the connection. This can be a problem for example with Xwayland mapping a lot of windows, faster than the Wayland compositor can cope with, or a high-rate mouse flooding the Wayland client with pointer events. To avoid the issue, resize the connection buffers dynamically when they get full. Both data and fd buffers are resized on demand. The default max buffer size is controlled via the wl_display interface while each client's connection buffer size is adjustable for finer control. The purpose is to explicitly have larger connection buffers for specific clients such as Xwayland, or set a larger buffer size for the client with pointer focus to deal with a higher input events rate. v0: Manuel: Dynamically resize connection buffers - Both data and fd buffers are resized on demand. v1: Olivier 1. Add support for unbounded buffers on the client side and growable (yet limited) connection buffers on the server side. 2. Add the API to set the default maximum size and a limit for a given client. 3. Add tests for growable connection buffers and adjustable limits. v2: Additional fixes by John: 1. Fix the size calculation in ring_buffer_check_space() 2. Fix wl_connection_read() to return gracefully once it has read up to the max buffer size, rather than returning an error. 3. If wl_connection_flush() fails with EAGAIN but the transmit ring-buffer has space remaining (or can be expanded), wl_connection_queue() should store the message rather than returning an error. 4. When the receive ring-buffer is at capacity but more data is available to be read, wl_connection_read() should attempt to expand the ring-buffer in order to read the remaining data. v3: Thomas Lukaszewicz <tluk@chromium.org> Add a test for unbounded buffers v4: Add a client API as well to force bounded buffers (unbounded by default (Olivier) v5: Simplify ring_buffer_ensure_space() (Sebastian) Co-authored-by: Olivier Fourdan <ofourdan@redhat.com> Co-authored-by: John Lindgren <john@jlindgren.net> Co-authored-by: Sebastian Wick <sebastian@sebastianwick.net> Signed-off-by: Manuel Stoeckl <code@mstoeckl.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Signed-off-by: John Lindgren <john@jlindgren.net> Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net> Closes: https://gitlab.freedesktop.org/wayland/wayland/-/issues/237
* util: convert macros to inline functionsSimon Ser2024-03-281-3/+17
| | | | | | | Functionally equivalent except the usual macro footguns are avoided and type safety is increased. Signed-off-by: Simon Ser <contact@emersion.fr>
* scanner: add new enum-header modeSimon Ser2024-03-281-1/+36
| | | | | | | This generates a header with only enum definitions. This is useful to share enum headers between libraries and library users. Signed-off-by: Simon Ser <contact@emersion.fr>
* util: fix undefined behavior in wl_array_for_eachDavid Benjamin2024-03-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | If a wl_array has size zero, wl_array_for_each computes NULL + 0 to get to the end pointer. This should be fine, and indeed it would be fine in C++. But the C specification has a mistake here and it is actually undefined behavior. See https://davidben.net/2024/01/15/empty-slices.html Clang's -fsanitize=undefined flags this. I ran into this in Chromium's build with wayland-scanner on one of our XML files. ../../third_party/wayland/src/src/scanner.c:1853:2: runtime error: applying zero offset to null pointer #0 0x55c979b8e02c in emit_code third_party/wayland/src/src/scanner.c:1853:2 #1 0x55c979b89323 in main third_party/wayland/src/src/scanner.c #2 0x7f8dfdb8c6c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16 #3 0x7f8dfdb8c784 in __libc_start_main csu/../csu/libc-start.c:360:3 #4 0x55c979b70f39 in _start (...) An empty XML file is sufficient to hit this case, so I've added it as a test. To reproduce, undo the fix and include only the test, then build with: CC=clang CFLAGS="-fno-sanitize-recover=undefined" meson build/ -Db_sanitize=undefined -Db_lundef=false ninja -C build test Signed-off-by: David Benjamin <davidben@google.com>
* connection: use enum wl_arg_type in wl_message_count_arrays()Simon Ser2024-03-061-1/+1
| | | | | | Missed it in 155dd63b58b8 ("Introduce enum wl_arg_type"). Signed-off-by: Simon Ser <contact@emersion.fr>
* client: simplify create_proxies() loopSimon Ser2024-03-061-15/+12
| | | | | | Decrease the indentation a bit. No functional change. Signed-off-by: Simon Ser <contact@emersion.fr>
* client: simplify create_outgoing_proxy() loopSimon Ser2024-03-061-10/+6
| | | | | | Decrease the indentation a bit. No functional change. Signed-off-by: Simon Ser <contact@emersion.fr>
* connection: simplify wl_closure_lookup_objects() loopSimon Ser2024-03-061-29/+26
| | | | | | Decrease the indentation a bit. No functional change. Signed-off-by: Simon Ser <contact@emersion.fr>
* Introduce enum wl_arg_typeSimon Ser2024-03-064-92/+111
| | | | | | | This is less cryptic to read than letters, and allows the compiler to check switch statements exhaustiveness. Signed-off-by: Simon Ser <contact@emersion.fr>
* Mitigate UAF crashes due to wl_client_destroy reentrancyThomas Lukaszewicz2024-02-231-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are situations in which a call into wl_client_destroy() can result in a reentrant call into wl_client_destroy() - which results in UAF / double free crashes. For example, this can occur in the following scenario. 1. Server receives a message notifying it that a client has disconnected (WL_EVENT_HANGUP [1]) 2. This beings client destruction with a call to wl_client_destroy() 3. wl_client_destroy() kicks off callbacks as client-associated resources are cleaned up and their destructors and destruction signals are invoked. 4. These callbacks eventually lead to an explicit call to wl_display_flush_clients() as the server attempts to flush events to other connected clients. 5. Since the client has already begun destruction, when it is reached in the iteration the flush fails wl_client_destroy() is called again [2]. This patch guards against this reentrant condition by removing the client from the display's client list when wl_client_destroy() is first called. This prevents access / iteration over the client after wl_client_destroy() is called. In the example above, wl_display_flush_clients() will pass over the client currently undergoing destruction and the reentrant call is avoided. [1] https://gitlab.freedesktop.org/wayland/wayland/-/blob/8f499bf4045f88f3a4b4b0a445befca467bebe20/src/wayland-server.c#L342 [2] https://gitlab.freedesktop.org/wayland/wayland/-/blob/8f499bf4045f88f3a4b4b0a445befca467bebe20/src/wayland-server.c#L1512 Signed-off-by: Thomas Lukaszewicz [thomaslukaszewicz@gmail.com](mailto:thomaslukaszewicz@gmail.com)
* build: fix build and provide compat for OpenBSDSébastien Marie2024-02-211-0/+4
| | | | | | | | | | - wayland-egl-abi-check: try to use llvm-nm first instead of BSD nm (incompatible options) - avoid forcing _POSIX_C_SOURCE=200809L (SOCK_CLOEXEC become available) - epoll(7) is provided by a userspace wrapper around kqueue(2) as FreeBSD - when using SO_PEERCRED, the struct to use is `struct sockpeercred` instead of `struct ucred` on OpenBSD - provide a compatibility layer for count_open_fds() using sysctl(2) as FreeBSD Signed-off-by: Sebastien Marie <semarie@online.fr>
* server: add wl_client_get_user_data/wl_client_set_user_dataSebastian Wick2024-02-152-0/+56
| | | | | | | | | | | | | | | | The only way to attach some data to a wl_client seems to be setting up a destroy listener and use wl_container_of. Let's make it straight forward to attach some data. Having an explicit destroy callback for the user data makes managing the user data lifetime much more convenient. All other callbacks, be they wl_resource request listeners, destroy listeners or destructors, or wl_client destroy listeners, can assume that the wl_client user data still exists if it was set. Otherwise making that guarantee would be complicated. Co-authored-by: Pekka Paalanen <pekka.paalanen@collabora.com> Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
* event-loop: use wl_priv_signal for the destroy signalKirill Primak2024-02-081-5/+6
| | | | Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
* Mitigate UAF crashes due to iteration over freed wl_resourcesThomas Lukaszewicz2024-02-071-19/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently it is possible to iterate over client-owned resources during client destruction that have had their associated memory released. This can occur when client code calls wl_client_destroy(). The following sequence illustrates how this may occur. 1. The server initiates destruction of the connected client via call to wl_client_destroy(). 2. Resource destroy listeners / destructors are invoked and resource memory is freed one resource at a time [1]. 3. If a listener / destructor for a resource results in a call to wl_client_for_each_resource(), the iteration will proceed over resources that have been previously freed in step 2, resulting in UAFs / crashes. The issue is that resources remain in the client's object map even after they have had their memory freed, and are removed from the map only after each individual resource has had its memory released. This patch corrects this by ensuring resource destruction first invokes listeners / destructors and then removing them from the client's object map before releasing the associated memory. [1] https://gitlab.freedesktop.org/wayland/wayland/-/blob/main/src/wayland-server.c?ref_type=heads#L928 Signed-off-by: Thomas Lukaszewicz thomaslukaszewicz@gmail.com
* client: Allow setting names for queuesDerek Foreman2024-01-225-16/+106
| | | | | | | | | | Allow setting a name for an event queue. The queue is used only for printing additional debug information. Debug output can now show the name of the event queue an event is dispatched from, or the event queue of a proxy when a request is made. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* connection: Spruce up logging for client errors.Erik Chen2024-01-191-6/+25
| | | | | | | | | Some code paths that lead to a client error and connection termination have no associated logging, or insufficient logging. This makes it difficult to understand what went wrong. This commit adds or supplements logging for all these code paths. Signed-off-by: Erik Chen <erikchen@chromium.org>
* connection: Small simplification to wl_connection_write()John Lindgren2024-01-191-8/+1
| | | | | | | | wl_connection_write() contained an exact copy of the logic in wl_connection_queue(). Simplify things by just calling wl_connection_queue() from wl_connection_write(). Signed-off-by: John Lindgren <john@jlindgren.net>
* Consider pkgconfig sysroot for pkgdatadirAndreas Cord-Landwehr2024-01-191-3/+3
| | | | | | | For libs/cflags this is done automatically, but not for manually accessed variables. This matches what wayland-protocols does. Signed-off-by: Andreas Cord-Landwehr <cordlandwehr@kde.org>
* shm: implement version 2Simon Ser2024-01-191-2/+9
| | | | | | This version adds a release request. Signed-off-by: Simon Ser <contact@emersion.fr>
* shm: fix resource versionsSimon Ser2024-01-191-2/+5
| | | | | | | This was hardcoded to 1 regardless of the version passed to the callback or the version of the parent resource. Signed-off-by: Simon Ser <contact@emersion.fr>
* util: use C23 deprecated attributeSimon Ser2024-01-191-1/+3
| | | | Signed-off-by: Simon Ser <contact@emersion.fr>
* util: use C23 typeof if availableSimon Ser2024-01-191-2/+8
| | | | | | | Instead of using the non-standard __typeof__, prefer the standard typeof operator introduced in C23. Signed-off-by: Simon Ser <contact@emersion.fr>
* util: simplify wl_fixed_from_double()Simon Ser2023-11-211-8/+1
| | | | | | | Same as 0e0ae7e290f2 ("util: simplify wl_fixed_to_double()"), but for the reverse function. Signed-off-by: Simon Ser <contact@emersion.fr>
* connection: avoid calling memcpy on NULL, 0David Benjamin2023-11-081-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to what is arguably a mistake in the C language specification, passing NULL to memcpy and friends is undefined behavior (UB) even when the count is 0. C additionally mistakenly leaves NULL + 0 and NULL - NULL undefined. (C++ fixes this mistake.) These are very problematic because (NULL, 0) is a natural representation of the empty slice. Some details: https://github.com/llvm/llvm-project/issues/49459 https://www.imperialviolet.org/2016/06/26/nonnull.html Unfortunately, despite how clearly this is a mistake, glibc headers and GCC now try to exploit this specification mistake and will miscompile code, so C projects need to workaround this. In particular, UBSan from Clang will flag this as a bug (although Clang itself has the good sense to never lean on this bug). We've run into a few UBSan errors in Chromium stemming from Wayland's memcpy calls. Add runtime guards as needed to avoid these cases. Note: Chromium's copy of wayland has https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/188 applied. It is possible the ring_buffer_copy UB cases are only reachable with that MR applied, I'm not sure. But it seemed simplest to just add the fix to wayland as-is. Then when/if that MR lands, it will pick this up. Signed-off-by: David Benjamin <davidben@google.com>
* client: Add method to get display for a given proxyDavid Edmundson2023-08-072-0/+17
| | | | | | | | This can be useful for additional validation purposes when handling proxies. This is similar to existing server side API wl_global_get_display. Signed-off-by: David Edmundson <david@davidedmundson.co.uk>
* debug: Replace "@<id>" with "#<id>" in logsAlex Yang2023-06-273-10/+10
| | | | | | | | | | | | Wayland debug logs resemble email addresses. This is a problem when anonymizing logs from users. For example: [2512874.343] xdg_surface@700.configure(333) In the above log line, the substring "surface@700.config" can be mistaken for an email address and redacted during anonymization. Signed-off-by: Alex Yang <aycyang@google.com>
* tests: manually wrap libc functionsSimon Ser2023-06-271-9/+15
| | | | | | | | | | | | The way we're wrapping libc functions via dlsym() is pretty fragile and breaks on FreeBSD. The failures happen in our CI and are pretty random, see e.g. [1]. Use a more manual way to wrap via a function pointer. [1]: https://gitlab.freedesktop.org/wayland/wayland/-/jobs/44204010 Signed-off-by: Simon Ser <contact@emersion.fr>
* server: use bool in struct fieldsSimon Ser2023-05-301-8/+8
| | | | | | | | | | Use bool instead of int for boolean values, to make it more explicit what the field contains. For instance "error" is not to be confused with an error code. This is all private API. Signed-off-by: Simon Ser <contact@emersion.fr>
* build: override wayland-scanner depSimon Ser2023-05-091-0/+3
| | | | | | This allows a parent project to find wayland-scanner. Signed-off-by: Simon Ser <contact@emersion.fr>
* server: stop wl_display_run() on dispatch errorSimon Ser2023-05-091-1/+3
| | | | | | | If wl_event_loop_dispatch() fails, we could enter an infinite loop, repeatedly calling a failing wl_event_loop_dispatch() forever. Signed-off-by: Simon Ser <contact@emersion.fr>
* util: simplify wl_fixed_to_double()Simon Ser2023-05-091-8/+1
| | | | | | | | We can just use a simple division instead of bit operations with magic numbers. Readability matters more than performance here. References: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/296 Signed-off-by: Simon Ser <contact@emersion.fr>
* event-loop: optimize timer check logicYang Wang2023-05-031-1/+3
| | | | | | | the 'has_timers' flag can be returned directly without having to track all the ready events when a timer is found ready. Signed-off-by: Yang Wang <KevinYang.Wang@amd.com>
* event-loop: Handle EINTR and EAGAIN in wl_event_loop_dispatchJoshua Ashton2023-05-021-1/+76
| | | | | | | | | | | This fixes an issue where it was not possible to start Gamescope under GDB on some setups. https://github.com/ValveSoftware/gamescope/issues/743 Any signals would cause epoll_wait to return -1 and set errno to EINTR. This also handles the EAGAIN case like the other polling loops in libwayland. Signed-off-by: Joshua Ashton <joshua@froggi.es>
* client: fix wl_display_disconnect() documentationSimon Ser2023-03-071-2/+3
| | | | | Signed-off-by: Simon Ser <contact@emersion.fr> Closes: https://gitlab.freedesktop.org/wayland/wayland/-/issues/361
* client: Do not warn about attached proxies on default queue destruction.Alexandros Frantzis2023-03-011-5/+9
| | | | | | | | | | | | | | If the default queue is being destroyed, the client is disconnecting from the wl_display, so there is no possibility of subsequent events being queued to the destroyed default queue, which is what this warning is about. Note that interacting with (e.g., destroying) a wl_proxy after its wl_display is destroyed is a certain memory error, and this warning will indirectly warn about this issue. However, this memory error should be detected and warned about through a more deliberate mechanism. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
* client: Abort when trying to add an event to a destroyed queueAlexandros Frantzis2023-02-281-0/+5
| | | | | | | | | | Detect when we are trying to add an event to a destroyed queue, and abort instead of causing a use-after-free memory error. This situation can occur when an wl_event_queue is destroyed before its attached wl_proxy objects. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
* client: Warn when a queue is destroyed with attached proxiesAlexandros Frantzis2023-02-281-0/+16
| | | | | | | Log a warning if the queue is destroyed while proxies are still attached, to help developers debug and fix potential memory errors. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
* client: Track the proxies attached to a queueAlexandros Frantzis2023-02-281-0/+22
| | | | | | | | Maintain a list of all wl_proxy objects that are attached to a wl_event_queue. We will use this information in upcoming commits to warn about improper object destruction order that can lead to memory errors. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
* shm: fix segfault when accessing destroyed pool resourceSimon Ser2023-02-271-4/+6
| | | | | | | | | | | With wl_shm_buffer_ref_pool(), it's possible for a wl_shm_pool to outlive its wl_resource. We need to be careful not to access wl_shm_pool.resource if it's been destroyed. Reset resource to NULL in the resource destroy handler, and add NULL checks. Signed-off-by: Simon Ser <contact@emersion.fr>
* wayland-server: Add method to get global nameAndri Yngvason2023-02-112-0/+21
| | | | | | | This is useful for protocol designs where globals need to be referenced in some manner. Signed-off-by: Andri Yngvason <andri@yngvason.is>
* server: rename wl_display.id to next_global_nameSimon Ser2023-01-251-4/+4
| | | | | | | This is much more descriptive. This value is a counter incremented each time a new global is created. Signed-off-by: Simon Ser <contact@emersion.fr>
* server: fail on global name overflowSimon Ser2023-01-251-0/+5
| | | | | | | | | display->id is initialized to 1, making 0 a convenient value to indicate an invalid global name. Make sure to not return a zero global name on overflow. Moreover, if we wrap around, we might cycle back to a global name which is already in-use. Signed-off-by: Simon Ser <contact@emersion.fr>
* scanner: Fix undefined behavior around qsortFergus Dall2023-01-031-2/+7
| | | | | | | | | According to clang, qsort cannot be passed a null pointer, even if the size is specified to be zero. The scanner can hit this while trying to sort forward declarations if it happens to be building a protocol file that doesn't require any, either in the header or the source. Signed-off-by: Fergus Dall <sidereal@google.com>
* wayland-server: Add wl_client_add_destroy_late_listenerDaniel Stone2022-10-202-0/+50
| | | | | | | | | | A late-destroy listener for a client is called after all the client's resources have been destroyed and the destroy callbacks emitted. This lives in parallel to the existing client destroy listener, called immediately before the client's objects get destroyed. Signed-off-by: Daniel Stone <daniels@collabora.com> Fixes: wayland/wayland#207
* server: don't document void return valuesSimon Ser2022-09-131-2/+0
| | | | | | | | | Fixes the following warnings: src/wayland-server.c:1152: warning: documented empty return type of wl_display::wl_display_destroy src/wayland-server.c:1193: warning: documented empty return type of wl_display::wl_display_set_global_filter Signed-off-by: Simon Ser <contact@emersion.fr>
* util: name function typedef argumentsSimon Ser2022-09-131-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Doxygen doesn't support documenting unnamed function arguments. Fixes the following warnings: src/wayland-util.h:697: warning: argument 'const' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:697: warning: argument 'void' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:697: warning: argument 'void' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:697: warning: argument 'uint32_t' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:697: warning: argument 'const' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:697: warning: argument 'struct' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:697: warning: argument 'wl_message' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:697: warning: argument 'union' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:697: warning: argument 'wl_argument' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:725: warning: argument 'const' of command @param is not found in the argument list of wl_log_func_t(const char *, va_list) src/wayland-util.h:725: warning: argument 'char' of command @param is not found in the argument list of wl_log_func_t(const char *, va_list) src/wayland-util.h:725: warning: argument 'va_list' of command @param is not found in the argument list of wl_log_func_t(const char *, va_list) src/wayland-util.h:697: warning: argument 'const' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:697: warning: argument 'void' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:697: warning: argument 'void' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:697: warning: argument 'uint32_t' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:697: warning: argument 'const' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:697: warning: argument 'struct' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:697: warning: argument 'wl_message' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:697: warning: argument 'union' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:697: warning: argument 'wl_argument' of command @param is not found in the argument list of wl_dispatcher_func_t(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *) src/wayland-util.h:725: warning: argument 'const' of command @param is not found in the argument list of wl_log_func_t(const char *, va_list) src/wayland-util.h:725: warning: argument 'char' of command @param is not found in the argument list of wl_log_func_t(const char *, va_list) src/wayland-util.h:725: warning: argument 'va_list' of command @param is not found in the argument list of wl_log_func_t(const char *, va_list) Signed-off-by: Simon Ser <contact@emersion.fr>
* server: Extend display name string sizeCarlos Garnacho2022-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | Typically this is a number between 0 and 32. Just that the compiler doesn't know that well. Make the string buffer a bit larger, so that it fits the longer integers. Fixes build warnings like: ../subprojects/wayland/src/wayland-server.c: In function ‘wl_display_add_socket_auto’: ../subprojects/wayland/src/wayland-server.c:1649:70: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 8 [-Werror=format-truncation=] 1649 | snprintf(display_name, sizeof display_name, "wayland-%d", displayno); | ^~ ../subprojects/wayland/src/wayland-server.c:1649:61: note: directive argument in the range [-2147483647, 32] 1649 | snprintf(display_name, sizeof display_name, "wayland-%d", displayno); | ^~~~~~~~~~~~ ../subprojects/wayland/src/wayland-server.c:1649:17: note: ‘snprintf’ output between 10 and 20 bytes into a destination of size 16 1649 | snprintf(display_name, sizeof display_name, "wayland-%d", displayno); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Seen in GTK CI. Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
* Document which type are nullable, and wire format for null valueIan Douglas Scott2022-07-141-1/+1
| | | | Signed-off-by: Ian Douglas Scott <idscott@system76.com>