mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-19 01:00:26 +01:00
core: avoid "-Wmaybe-uninitialized" warning in update_system_hostname() with LTO
When building without more-assertions and LTO, the compiler might think
that "wait" is uninitialized. Avoid the warning.
Initializing a variable is not a great solution either, because
potentially it could hide an actual bug. But it still seems to be
best.
src/nm-policy.c: In function update_system_hostname:
src/nm-policy.c:909: warning: wait may be used uninitialized in this function [-Wmaybe-uninitialized]
909 | if (wait) {
|
src/nm-policy.c:901: note: wait was declared here
901 | gboolean wait;
|
This commit is contained in:
parent
123765befc
commit
f8026717e4
1 changed files with 1 additions and 1 deletions
|
|
@ -898,7 +898,7 @@ update_system_hostname(NMPolicy *self, const char *msg)
|
|||
|
||||
if (info->from_dns && info->ip_x[IS_IPv4]) {
|
||||
const char *result;
|
||||
gboolean wait;
|
||||
gboolean wait = FALSE;
|
||||
|
||||
result =
|
||||
nm_device_get_hostname_from_dns_lookup(info->device, addr_family, &wait);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue