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 759588 - Trivial: uninitialized variable.
Trivial: uninitialized variable.
Status: RESOLVED FIXED
Product: gnome-calendar
Classification: Applications
Component: Backend
unspecified
Other Linux
: Normal normal
: 3.26
Assigned To: GNOME Calendar maintainers
GNOME Calendar maintainers
Depends on:
Blocks:
 
 
Reported: 2015-12-17 13:05 UTC by Miguel Vaello Martínez
Modified: 2017-04-17 18:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix uninitialized variable (1.32 KB, patch)
2015-12-17 13:07 UTC, Miguel Vaello Martínez
committed Details | Review

Description Miguel Vaello Martínez 2015-12-17 13:05:06 UTC
After build the project, I was reviewing trace of the compiling and saw the following message (sorry for the trace in spanish):

```
gcal-utils.c: En la función ‘icaltime_compare_with_current’:
gcal-utils.c:449:10: aviso: puede ser que se utilice ‘result’ sin inicializar en esta función [-Wmaybe-uninitialized]
   return result;
          ^
gcal-utils.c:420:8: nota: ‘result’ se declaró aquí
   gint result;
        ^
```

Basically the 'result' var is uninitialized.

I'm not sure if the attached patch breaks any coding convention, but solves the warning and simplifies the code a little.
Comment 1 Miguel Vaello Martínez 2015-12-17 13:07:21 UTC
Created attachment 317559 [details] [review]
Fix uninitialized variable
Comment 2 Erick Perez Castellanos 2015-12-22 02:13:30 UTC
Comment on attachment 317559 [details] [review]
Fix uninitialized variable

Pushed as commit 2001273
Comment 3 Erick Perez Castellanos 2015-12-22 02:13:52 UTC
Thanks for working on this.