diff options
author | Luca Boccassi <luca.boccassi@gmail.com> | 2024-10-16 12:42:06 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2024-10-16 16:07:40 +0200 |
commit | 5f911aca8434b4163514019fcb4c1c967a50617c (patch) | |
tree | 0d4fbfb2a196887ea21e9ab1dfb9de2949e2cc74 /src/resolve/resolved-bus.c | |
parent | pid1: add env var to override default mount rate limit interval (diff) | |
download | systemd-5f911aca8434b4163514019fcb4c1c967a50617c.tar.xz systemd-5f911aca8434b4163514019fcb4c1c967a50617c.zip |
Fix maybe-uninitialized warnings with gcc 14.2
../src/resolve/resolved-bus.c: In function ‘call_link_method’:
../src/resolve/resolved-bus.c:1769:16: warning: ‘l’ may be used uninitialized [-Wmaybe-uninitialized]
1769 | return handler(message, l, error);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../src/resolve/resolved-bus.c:1755:15: note: ‘l’ was declared here
1755 | Link *l;
| ^
../src/resolve/resolved-bus.c: In function ‘bus_method_get_link’:
../src/resolve/resolved-bus.c:1828:13: warning: ‘l’ may be used uninitialized [-Wmaybe-uninitialized]
1828 | p = link_bus_path(l);
| ^~~~~~~~~~~~~~~~
../src/resolve/resolved-bus.c:1816:15: note: ‘l’ was declared here
1816 | Link *l;
| ^
Diffstat (limited to '')
-rw-r--r-- | src/resolve/resolved-bus.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resolve/resolved-bus.c b/src/resolve/resolved-bus.c index 58701bc656..2fc702200c 100644 --- a/src/resolve/resolved-bus.c +++ b/src/resolve/resolved-bus.c @@ -1752,7 +1752,7 @@ static int get_any_link(Manager *m, int ifindex, Link **ret, sd_bus_error *error static int call_link_method(Manager *m, sd_bus_message *message, sd_bus_message_handler_t handler, sd_bus_error *error) { int ifindex, r; - Link *l; + Link *l = NULL; /* avoid false maybe-uninitialized warning */ assert(m); assert(message); @@ -1813,7 +1813,7 @@ static int bus_method_get_link(sd_bus_message *message, void *userdata, sd_bus_e _cleanup_free_ char *p = NULL; Manager *m = ASSERT_PTR(userdata); int r, ifindex; - Link *l; + Link *l = NULL; /* avoid false maybe-uninitialized warning */ assert(message); |