gcc warnings compiling the new gvaluecollector on snow leopard
Submitted by Alessandro Decina
Link to original bug (#607002)
Description
Created attachment 151419 fix
Compiling telepathy-glib (git d74822) with glib (git 956b3b) on snow leopard I get:
cc1: warnings being treated as errors dbus.c: In function ‘tp_asv_new’: dbus.c:747: warning: declaration of ‘_value’ shadows a previous local dbus.c:747: warning: shadowed declaration is here dbus.c:747: warning: declaration of ‘_vtable’ shadows a previous local dbus.c:747: warning: shadowed declaration is here make[3]: *** [dbus.lo] Error 1 make[2]: *** [all] Error 2
This is the content of dbus.c:
... 733 GValue *value; 734 char error = NULL; / NB: not a GError! / 735 736 / create a GHashTable */ 737 GHashTable *asv = g_hash_table_new_full (g_str_hash, g_str_equal, 738 NULL, (GDestroyNotify) tp_g_value_slice_free); 739 740 va_start (var_args, first_key); 741 742 for (key = (char *) first_key; key != NULL; key = va_arg (var_args, char *)) 743 { 744 type = va_arg (var_args, GType); 745 746 value = tp_g_value_slice_new (type); 747 G_VALUE_COLLECT (value, var_args, 0, &error); 748 749 if (error != NULL) ...
What is failing is the expansion of G_VALUE_COLLECT. The attached patch fixes the issue.
Patch 151419, "fix":
0001-gvaluecollector-fix-warnings-under-osx-snow-leopard.patch