
#include <gtk/gtk.h>

/*
  If I build this with:

    cc `pkg-config --cflags --libs gtk+-2.0` test-get-type.c

  it outputs: "Type: 3860" which is fine.

  However, if I build with '-O2' (with or without '-g'), i.e.:

    cc -O2 `pkg-config --cflags --libs gtk+-2.0` test-get-type.c

  it outputs: "Type: 0" which is scary. If I run it in gdb it seems to skip
  the call to gtk_color_selection_dialog_get_type() completely.
  So it looks like a gcc bug.

  (This is with gcc 2.96, RedHat 7.1)
*/

int
main (int argc, char *argv[])
{
  GtkType type;

  gtk_init (&argc, &argv);

  /*G_BREAKPOINT ();*/

  /* Initialise the GTK type */
  gtk_color_selection_dialog_get_type ();

  /* Try to get the type from the class name. */
  type = g_type_from_name ("GtkColorSelectionDialog");
  g_print ("Type: %i\n", type);
}
