chiark / gitweb /
libsystemd: fix compiler warning in property_get_set_callbacks_run()
authorDaniel Mack <zonque@gmail.com>
Thu, 20 Feb 2014 16:14:50 +0000 (17:14 +0100)
committerDaniel Mack <zonque@gmail.com>
Thu, 20 Feb 2014 16:18:07 +0000 (17:18 +0100)
gcc (4.8.2, arm) doesn't understand that vtable_property_get_userdata()
will always set 'u' when it returns > 0. Hence, the warning is bogus,
but anyway.

  src/libsystemd/sd-bus/bus-objects.c:510:19: warning: 'u' may be used uninitialized in this function [-Wmaybe-uninitialized]

(and yes, indeed, even the reported line numbers are bogus in this case)

src/libsystemd/sd-bus/bus-objects.c

index 85800cb348525f49a39a08aa07a367de7673ac15..7d325fab33a3b1daf9ba242418af7bee625cfe46 100644 (file)
@@ -527,7 +527,7 @@ static int property_get_set_callbacks_run(
 
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
         _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
 
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
         _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
-        void *u;
+        void *u = NULL;
         int r;
 
         assert(bus);
         int r;
 
         assert(bus);