From 4cf244e22877388adcabef133e66b2810c0ab664 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 7 Apr 2013 19:50:26 -0700 Subject: Fix some of the gcc-4.8 warnings Most of the warnings are IMHO false positives: e.g.: an enum variable is initialized in a switch statement that has a case for each possible enum value - yet gcc 4.8 warns that it could be used uninitialized; or: two variables are initialized together in the code - second one of them is previously initialized to -1 at declaration time, both are initialized in an if (second one == -1) clause - so they are guaranteed to both be initialized... I did not "fix" those as the code is actually correct. But there are three spots where it catches things that could indeed go wrong (with odd input data in one of them). This commit also adds a check to only call g_type_init() for older versions of glib as in newer ones it is deprecated. Signed-off-by: Dirk Hohndel --- statistics.c | 1 + 1 file changed, 1 insertion(+) (limited to 'statistics.c') diff --git a/statistics.c b/statistics.c index a39799a08..502c06cb4 100644 --- a/statistics.c +++ b/statistics.c @@ -668,6 +668,7 @@ static void get_ranges(char *buffer, int size) } } } + len = strlen(buffer); if (first != last) { if (first + 1 == last) snprintf(buffer + len, size - len, ", %d", last); -- cgit v1.2.3-70-g09d2