GNOME Bugzilla – Bug 572649
"char ***" dbus callback argument not casted
Last modified: 2010-10-16 13:43:36 UTC
The following vala code: <vala code> this.search.Query (0, this.category, new string[0], "", new string[0], "", false, new string[0], false, 0, -1, on_search_query_cb); ... private void on_search_query_cb (string[][] search_result, GLib.Error error) { </vala code> generates following C code: <c code> static void rygel_tracker_category_on_search_query_cb (RygelTrackerCategory* self, char*** search_result, int search_result_length1, GError* error) { ... static void _rygel_tracker_category_on_search_query_cb_cb (DBusGProxy* proxy, DBusGProxyCall* call, void* user_data) { GError* error; GPtrArray* search_result; error = NULL; dbus_g_proxy_end_call (proxy, call, &error, dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRV), &search_result, G_TYPE_INVALID); rygel_tracker_category_on_search_query_cb (user_data, search_result->pdata, search_result->len, error); } ... dbus_g_proxy_begin_call (self, "Query", _rygel_tracker_category_on_search_query_cb_cb, param12_target, NULL, G_TYPE_INT, param1, G_TYPE_STRING, param2, G_TYPE_STRV, param3, G_TYPE_STRING, param4, G_TYPE_STRV, param5, G_TYPE_STRING, param6, G_TYPE_BOOLEAN, param7, G_TYPE_STRV, param8, G_TYPE_BOOLEAN, param9, G_TYPE_INT, param10, G_TYPE_INT, param11, G_TYPE_INVALID, G_TYPE_INVALID); </c code> The problem is search_result->pdata above is not being casted to "char ***" before getting passed to rygel_tracker_category_on_search_query_cb as it should be and therefore C compiler warns about it.
It doesn't make a lot of sense to work on fixing C compiler warnings in the old dbus-glib based code, so probably won't fix.
commit cc435dd6ec069b87e986fa454e80e5fe80a0df72 Author: Jürg Billeter <j@bitron.ch> Date: Sat Oct 16 15:17:23 2010 +0200 Report error when trying to use stacked arrays Stacked array support was never completed. Report an error instead of generating incorrect C code. Fixes bug 546603, bug 548428, bug 548429, bug 565865, bug 565872, bug 571322, bug 572649, and bug 576611.