In file included from ../../mono/eglib/glib.h:45:0,
authorJay Krell <jaykrell@microsoft.com>
Thu, 13 Jun 2019 08:47:52 +0000 (01:47 -0700)
committerLarry Ewing <lewing@microsoft.com>
Tue, 18 Jun 2019 02:53:08 +0000 (21:53 -0500)
                 from os-event.h:9,
                 from os-event-unix.c:11:
../../mono/eglib/eglib-remap.h:146:25: warning: 'data' may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define g_ptr_array_add monoeg_g_ptr_array_add
                         ^~~~~~~~~~~~~~~~~~~~~~
os-event-unix.c:121:19: note: 'data' was declared here
  OSEventWaitData *data;
                   ^~~~

Commit migrated from https://github.com/mono/mono/commit/96129ba873ef4a31212a90be8f3137f39f9ead56

src/mono/mono/utils/os-event-unix.c

index 24b0b1d..ef04c1e 100644 (file)
@@ -102,9 +102,7 @@ typedef struct {
 static void
 signal_and_unref (gpointer user_data)
 {
-       OSEventWaitData *data;
-
-       data = (OSEventWaitData*) user_data;
+       OSEventWaitData *data = (OSEventWaitData*) user_data;
 
        mono_os_event_set (&data->event);
        if (mono_atomic_dec_i32 ((gint32*) &data->ref) == 0) {
@@ -118,7 +116,7 @@ mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waita
 {
        MonoOSEventWaitRet ret;
        mono_cond_t signal_cond;
-       OSEventWaitData *data;
+       OSEventWaitData *data = NULL;
        gboolean alerted;
        gint64 start;
        gint i;