From d143319bce8fc778df93fe7cd7ef4d03b7a3fc92 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Sat, 13 Oct 2018 16:24:56 +0000 Subject: [PATCH 81/83] SBUS: Silence warning maybe-uninitialized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Pavel Březina --- src/sbus/interface/sbus_properties.c | 2 ++ 1 file changed, 2 insertions(+) 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, -- 2.9.5