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:
@@ -898,7 +898,7 @@ update_system_hostname(NMPolicy *self, const char *msg)
|
|||||||
|
|
||||||
if (info->from_dns && info->ip_x[IS_IPv4]) {
|
if (info->from_dns && info->ip_x[IS_IPv4]) {
|
||||||
const char *result;
|
const char *result;
|
||||||
gboolean wait;
|
gboolean wait = FALSE;
|
||||||
|
|
||||||
result =
|
result =
|
||||||
nm_device_get_hostname_from_dns_lookup(info->device, addr_family, &wait);
|
nm_device_get_hostname_from_dns_lookup(info->device, addr_family, &wait);
|
||||||
|
Reference in New Issue
Block a user