mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-07 17:17:44 +03:00
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;
| ^
(cherry picked from commit 5f911aca8434b4163514019fcb4c1c967a50617c)
(cherry picked from commit 2590b77f39f7c1264b686e0b379465f5670631d3)
(cherry picked from commit 4c9509ad0c
)
This commit is contained in:
parent
b115781317
commit
7d275f119c
@ -1743,7 +1743,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);
|
||||
@ -1804,7 +1804,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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user