From 1b90c8b413286b3b8f841ee2090b5e0230d3641b Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Wed, 31 Aug 2016 19:58:14 +0200 Subject: [PATCH] month-view: initialize variable Some compilers seem to be over-pessimistic and abort the build with: gcal-month-view.c: In function 'gcal_month_view_drag_drop': gcal-month-view.c:908:32: error: 'timespan' may be used uninitialized in this function [-Werror=maybe-uninitialized] GDateTime *new_end = g_date_time_add (new_start, timespan); Even though the usage of the variable is guarded by an equal if as the assignment https://bugzilla.gnome.org/show_bug.cgi?id=770667 --- src/gcal-month-view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c index 36f23a49..bb8fde2c 100644 --- a/src/gcal-month-view.c +++ b/src/gcal-month-view.c @@ -865,7 +865,7 @@ gcal_month_view_drag_drop (GtkWidget *widget, gint cell, diff; gint start_month, current_month; gint start_year, current_year; - GTimeSpan timespan; + GTimeSpan timespan = 0; cell = get_dnd_cell (widget, x, y); event_widget = gtk_drag_get_source_widget (context);