After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 770667 - Initialize variable
Initialize variable
Status: RESOLVED FIXED
Product: gnome-calendar
Classification: Applications
Component: General
unspecified
Other All
: Normal normal
: 3.26
Assigned To: GNOME Calendar maintainers
GNOME Calendar maintainers
: 770673 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-08-31 18:03 UTC by Dominique Leuenberger
Modified: 2017-04-17 18:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Initialize variable (1.17 KB, patch)
2016-08-31 18:04 UTC, Dominique Leuenberger
committed Details | Review

Description Dominique Leuenberger 2016-08-31 18:03:58 UTC
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
Comment 1 Dominique Leuenberger 2016-08-31 18:04:01 UTC
Created attachment 334548 [details] [review]
Initialize variable
Comment 2 Ernestas Kulik 2016-08-31 19:58:56 UTC
*** Bug 770673 has been marked as a duplicate of this bug. ***
Comment 3 Georges Basile Stavracas Neto 2016-08-31 20:16:46 UTC
Thanks for the patch.
Comment 4 Dan Horák 2016-08-31 20:27:29 UTC
for the record - https://bugzilla.redhat.com/show_bug.cgi?id=1372072 is the bug against gcc for emitting the bogus(?) warning