GNOME Bugzilla – Bug 750335
Silence a bunch of warnings
Last modified: 2015-06-03 15:21:54 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.
Created attachment 304497 [details] [review] tests: Silence -Wunsafe-loop-optimizations
Created attachment 304503 [details] [review] demos: Silence -Wmaybe-uninitialized
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);
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
Created attachment 304513 [details] [review] demos: Silence -Wmaybe-uninitialized
Created attachment 304514 [details] [review] tests: Use GDataCalendarAccessRule for calendar ACLs
Review of attachment 304513 [details] [review]: ++, thanks
Review of attachment 304514 [details] [review]: This basically just changes the casting, right? I can’t see any functional changes in there.
Created attachment 304515 [details] [review] tests: Silence -Wunsafe-loop-optimizations
(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.
Review of attachment 304515 [details] [review]: ++
Created attachment 304526 [details] [review] tests: Silence -Wunused-function
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.