#include <assert.h>
#include <glib.h>

int bar[] = {0,0,0};

gint cmp (gconstpointer a,
          gconstpointer b,
          gpointer user_data)
{
    assert (a >= (gconstpointer)bar && a <= (gconstpointer)&bar[(sizeof bar / sizeof bar[0])-1]);
    assert (b >= (gconstpointer)bar && b <= (gconstpointer)&bar[(sizeof bar / sizeof bar[0])-1]);

    return -1;
}

int main (int argc, char *argv[])
{
    g_qsort_with_data (bar, sizeof bar / sizeof bar[0], sizeof bar[0], cmp, 0);

    return 0;
}
