GNOME Bugzilla – Bug 669613
deprecated use of g_value_array_get_nth error (when using jhbuild)
Last modified: 2012-05-17 13:49:54 UTC
nm-param-spec-specialized.c: In function 'nm_gvalue_ip6_address_compare': nm-param-spec-specialized.c:396:2: error: 'g_value_array_get_nth' is deprecated (declared at /opt/gnome/include/glib-2.0/gobject/gvaluearray.h:54): Use 'g_array_index' instead [-Werror=deprecated-declarations] nm-param-spec-specialized.c:399:2: error: 'g_value_array_get_nth' is deprecated (declared at /opt/gnome/include/glib-2.0/gobject/gvaluearray.h:54): Use 'g_array_index' instead [-Werror=deprecated-declarations] nm-param-spec-specialized.c:402:2: error: 'g_value_array_get_nth' is deprecated (declared at /opt/gnome/include/glib-2.0/gobject/gvaluearray.h:54): Use 'g_array_index' instead [-Werror=deprecated-declarations] nm-param-spec-specialized.c:406:2: error: 'g_value_array_get_nth' is deprecated (declared at /opt/gnome/include/glib-2.0/gobject/gvaluearray.h:54): Use 'g_array_index' instead [-Werror=deprecated-declarations] nm-param-spec-specialized.c:409:2: error: 'g_value_array_get_nth' is deprecated (declared at /opt/gnome/include/glib-2.0/gobject/gvaluearray.h:54): Use 'g_array_index' instead [-Werror=deprecated-declarations] nm-param-spec-specialized.c:412:2: error: 'g_value_array_get_nth' is deprecated (declared at /opt/gnome/include/glib-2.0/gobject/gvaluearray.h:54): Use 'g_array_index' instead [-Werror=deprecated-declarations] nm-param-spec-specialized.c: In function 'nm_gvalue_ip6_route_compare': nm-param-spec-specialized.c:455:2: error: 'g_value_array_get_nth' is deprecated (declared at /opt/gnome/include/glib-2.0/gobject/gvaluearray.h:54): Use 'g_array_index' instead [-Werror=deprecated-declarations] nm-param-spec-specialized.c:457:2: error: 'g_value_array_get_nth' is deprecated (declared at /opt/gnome/include/glib-2.0/gobject/gvaluearray.h:54): Use 'g_array_index' instead [-Werror=deprecated-declarations] nm-param-spec-specialized.c:459:2: error: 'g_value_array_get_nth' is deprecated (declared at /opt/gnome/include/glib-2.0/gobject/gvaluearray.h:54): Use 'g_array_index' instead [-Werror=deprecated-declarations] nm-param-spec-specialized.c:461:2: error: 'g_value_array_get_nth' is deprecated (declared at /opt/gnome/include/glib-2.0/gobject/gvaluearray.h:54): Use 'g_array_index' instead [-Werror=deprecated-declarations] nm-param-spec-specialized.c:465:2: error: 'g_value_array_get_nth' is deprecated (declared at /opt/gnome/include/glib-2.0/gobject/gvaluearray.h:54): Use 'g_array_index' instead [-Werror=deprecated-declarations] nm-param-spec-specialized.c:467:2: error: 'g_value_array_get_nth' is deprecated (declared at /opt/gnome/include/glib-2.0/gobject/gvaluearray.h:54): Use 'g_array_index' instead [-Werror=deprecated-declarations] nm-param-spec-specialized.c:469:2: error: 'g_value_array_get_nth' is deprecated (declared at /opt/gnome/include/glib-2.0/gobject/gvaluearray.h:54): Use 'g_array_index' instead [-Werror=deprecated-declarations] nm-param-spec-specialized.c:471:2: error: 'g_value_array_get_nth' is deprecated (declared at /opt/gnome/include/glib-2.0/gobject/gvaluearray.h:54): Use 'g_array_index' instead [-Werror=deprecated-declarations] cc1: all warnings being treated as errors
I encountered these build warnings when building NetworkManager using JHBuild. I didn't continue building further, so this might not be the only location that build errors might occur.
*** Bug 669901 has been marked as a duplicate of this bug. ***
Here's a workaround: $ echo 'module_autogenargs["NetworkManager"] = "--enable-more-warnings=no"' >> ~/.jhbuildrc
GValueArray has been deprecated since glib 2.32. But, we require => glib 2.22. So, we can't use new stuff to replace it now. Moreover, GValueArray is used by dbus-glib which we depend on. This can be used to suppress the deprecated warnings: diff --git a/m4/compiler_warnings.m4 b/m4/compiler_warnings.m4 index eeacfae..dc4a348 100644 --- a/m4/compiler_warnings.m4 +++ b/m4/compiler_warnings.m4 @@ -11,7 +11,7 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then -Wdeclaration-after-statement \ -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \ -fno-strict-aliasing -Wno-unused-but-set-variable \ - -Wundef; do + -Wno-deprecated-declarations -Wundef; do SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $option" AC_MSG_CHECKING([whether gcc understands $option])
fixed in NetworkManager and network-manager-applet when compiling against GLib 2.34 or later by using -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26. (To compile against GLib 2.32, you'll need to use --disable-more-warnings.)