Abuse of 'const' ?



Occasionally, I've noticed a couple of things like this when building Glib:-

// glib/gvariant.h
GLIB_AVAILABLE_IN_ALL
const gchar **g_variant_get_bytestring_array (GVariant *value, gsize *length);


// glib/gvariant.c
static gpointer
g_variant_valist_get_nnp (const gchar **str, GVariant *value)
{
        // some stuff
        return g_variant_get_bytestring_array (value, NULL);
}

This has the effect of converting const** into non-const gpointer. Is it worth reporting this kind of thing in bugzilla?

John


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]