glib2 G_GNUC_UNUSED

Elan Ruusamäe glen at delfi.ee
Fri Nov 3 01:21:41 CET 2006


is glib2 defining the macro incompatible for gcc in Ac, or there's some other cause?

$ g++ -c t.c `pkg-config --cflags glib-2.0` `pkg-config --cflags gtk+-2.0`
t.c:5: error: syntax error before `__attribute__'

$ cat t.c
#include <gtk/gtk.h>
#include <glib.h>

static void open_url_cb( GtkWidget *pButton G_GNUC_UNUSED, gpointer data )
{
}

$ g++ -E t.c `pkg-config --cflags glib-2.0` `pkg-config --cflags gtk+-2.0`>t.C
$ grep open_url_cb t.C
static void open_url_cb( GtkWidget *pButton __attribute__((__unused__)), gpointer data )

$ q gcc glib2 gtk+2
gcc-5:3.3.6-4
glib2-1:2.10.3-1
gtk+2-2:2.8.20-1
$

http://developer.gnome.org/doc/API/2.0/glib/glib-Miscellaneous-Macros.html#G-GNUC-UNUSED:CAPS

-- 
glen


More information about the pld-devel-en mailing list