From c8e9c7677393bfcab10e354cb08c947bbf940142 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Oct 13 2018 16:24:56 +0000 Subject: SBUS: Silence warning maybe-uninitialized It should not happen because function sbus_interface_find_property should return NULL for access different than SBUS_PROPERTY_READABLE or SBUS_PROPERTY_WRITABLE. And thus we would return ERR_SBUS_UNKNOWN_PROPERTY from the function sbus_request_property. src/sbus/interface/sbus_properties.c: In function 'sbus_request_property.isra.0': src/sbus/interface/sbus_properties.c:360:14: error: 'type' may be used uninitialized in this function [-Werror=maybe-uninitialized] sbus_req = sbus_request_create(mem_ctx, conn, type, destination, ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ interface_name, property_name, path); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Merges: https://pagure.io/SSSD/sssd/pull-request/3851 --- diff --git a/src/sbus/interface/sbus_properties.c b/src/sbus/interface/sbus_properties.c index bd15807..906e6db 100644 --- a/src/sbus/interface/sbus_properties.c +++ b/src/sbus/interface/sbus_properties.c @@ -355,6 +355,8 @@ sbus_request_property(TALLOC_CTX *mem_ctx, case SBUS_PROPERTY_WRITABLE: type = SBUS_REQUEST_PROPERTY_SET; break; + default: + return EINVAL; } sbus_req = sbus_request_create(mem_ctx, conn, type, destination,