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 750335 - Silence a bunch of warnings
Silence a bunch of warnings
Status: RESOLVED FIXED
Product: libgdata
Classification: Platform
Component: General
git master
Other All
: Normal normal
: ---
Assigned To: libgdata-maint
libgdata-maint
Depends on:
Blocks:
 
 
Reported: 2015-06-03 12:01 UTC by Debarshi Ray
Modified: 2015-06-03 15:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: Silence -Wunsafe-loop-optimizations (997 bytes, patch)
2015-06-03 12:05 UTC, Debarshi Ray
none Details | Review
demos: Silence -Wmaybe-uninitialized (947 bytes, patch)
2015-06-03 12:26 UTC, Debarshi Ray
none Details | Review
demos: Silence -Wmaybe-uninitialized (869 bytes, patch)
2015-06-03 13:39 UTC, Debarshi Ray
committed Details | Review
tests: Use GDataCalendarAccessRule for calendar ACLs (9.32 KB, patch)
2015-06-03 13:42 UTC, Debarshi Ray
committed Details | Review
tests: Silence -Wunsafe-loop-optimizations (1.06 KB, patch)
2015-06-03 13:47 UTC, Debarshi Ray
committed Details | Review
tests: Silence -Wunused-function (3.04 KB, patch)
2015-06-03 15:03 UTC, Debarshi Ray
rejected Details | Review

Description Debarshi Ray 2015-06-03 12:01:39 UTC
The introduction of AX_COMPILER_FLAGS and commit 68ed77fbafaa (bug 664353) has introduced a bunch of new warnings on top of the ones that we already had.

Let's fix these.
Comment 1 Debarshi Ray 2015-06-03 12:05:11 UTC
Created attachment 304497 [details] [review]
tests: Silence -Wunsafe-loop-optimizations
Comment 2 Debarshi Ray 2015-06-03 12:26:15 UTC
Created attachment 304503 [details] [review]
demos: Silence -Wmaybe-uninitialized
Comment 3 Philip Withnall 2015-06-03 12:42:02 UTC
Review of attachment 304497 [details] [review]:

::: gdata/tests/streams.c
@@ +129,3 @@
 	test_string = g_string_new (NULL);
 
+	for (i = start_num; i < end_num + 1; i++)

This could now overflow.

Please also add a precondition:
   g_return_val_if_fail (end_num < G_MAXUINT, NULL);
Comment 4 Philip Withnall 2015-06-03 12:43:44 UTC
Review of attachment 304503 [details] [review]:

::: demos/calendar/calendar-cli.c
@@ +237,3 @@
 	GError *error = NULL;
 	gint retval = 0;
+	gboolean only_own = FALSE;  /* only query for calendars the user owns */

I’d prefer that as an explicit else case in the if-statement just below, actually, so that all the possible settings of only_own are kept in the same place.

But otherwise, good catch. :-D
Comment 5 Debarshi Ray 2015-06-03 13:39:34 UTC
Created attachment 304513 [details] [review]
demos: Silence -Wmaybe-uninitialized
Comment 6 Debarshi Ray 2015-06-03 13:42:09 UTC
Created attachment 304514 [details] [review]
tests: Use GDataCalendarAccessRule for calendar ACLs
Comment 7 Philip Withnall 2015-06-03 13:44:12 UTC
Review of attachment 304513 [details] [review]:

++, thanks
Comment 8 Philip Withnall 2015-06-03 13:45:47 UTC
Review of attachment 304514 [details] [review]:

This basically just changes the casting, right? I can’t see any functional changes in there.
Comment 9 Debarshi Ray 2015-06-03 13:47:34 UTC
Created attachment 304515 [details] [review]
tests: Silence -Wunsafe-loop-optimizations
Comment 10 Debarshi Ray 2015-06-03 13:57:06 UTC
(In reply to Philip Withnall from comment #8)
> Review of attachment 304514 [details] [review] [review]:
> 
> This basically just changes the casting, right? I can’t see any functional
> changes in there.

Yes, just the casting, but that was enough to cause a bunch of warnings.
Comment 11 Philip Withnall 2015-06-03 15:01:06 UTC
Review of attachment 304515 [details] [review]:

++
Comment 12 Debarshi Ray 2015-06-03 15:03:54 UTC
Created attachment 304526 [details] [review]
tests: Silence -Wunused-function
Comment 13 Philip Withnall 2015-06-03 15:17:02 UTC
Review of attachment 304526 [details] [review]:

No. I have deliberately left those functions throwing warnings because the unit test suites need fixing to actually call them again. Silencing the warnings effectively removes that item from my to-do list.

The proper fix here is to fix those unit tests to call the functions again.