For anyone using g_variant_equal() with a type containing a dictionary, you should the aware that, somewhat unexpectedly in my opinion, g_variant_equal() only returns true if (and only if) the keys in the dictionary are in the same order (GVariant implements dictionaries as an array of key-value pairs).
You can resolve this by using a function that recursively checks for semantic equivalence (such as this one).
I’m sure I’m not going to be the only person to find this useful. I’ve filed this as bug #622590.
Did Ryan elaborate on why the order is important? Because this sounds like a bug in g_variant_equal() to me. And being able to memcmp() two variants does not sound like a good enough excuse to me.
Nothing that seemed really convincing to me. The main use for g_variant_equal() seems to be GHashTables, but you can only use simple variants (i.e. of type ‘?’) with g_variant_hash() anyway.
This kind of makes sense if you’re expanding a dictionary variant (i.e. of type a{?*}) into a GHashTable (which I think should also be a method provided by GLib), but in the more generic comparison case, there should be a method call for that.