From 1835a8a1055f797f8025a572a53088e2ccf0f1c6 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 23 Dec 2020 13:18:56 +0100 Subject: [PATCH] sd-dhcp-client: avoid "maybe-uninitialized" warning in client_timeout_resend() When compiling with CFLAGS='-Werror=maybe-uninitialized -Og' we get a warning about uninitialized "next_timeout" variable. Avoid the warning by adding an (unreachable) "default" label. Fixes: c24288d21ee9 ("sd-dhcp-client: correct dhcpv4 renew/rebind retransmit timeouts") --- src/libsystemd-network/sd-dhcp-client.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index 939dbac5bb..7604aafd6f 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -1275,6 +1275,9 @@ static int client_timeout_resend( case DHCP_STATE_STOPPED: r = -EINVAL; goto error; + + default: + assert_not_reached("Unhandled choice"); } r = event_reset_time(client->event, &client->timeout_resend,