Richard W.M. Jones
2019-Aug-29 18:14 UTC
[Libguestfs] [PATCH] p2v: Ignore gtk2 deprecated declarations.
This patch is against libguestfs's old copy of p2v, but the same patch ought to also apply against virt-p2v. Rich.
Richard W.M. Jones
2019-Aug-29 18:14 UTC
[Libguestfs] [PATCH] p2v: Ignore gtk2 deprecated declarations.
On latest Gtk2 the following warnings in main.c and gui.c cause the build to fail if warn-error is enabled. In file included from /usr/include/gtk-2.0/gtk/gtkobject.h:37, from /usr/include/gtk-2.0/gtk/gtkwidget.h:36, from /usr/include/gtk-2.0/gtk/gtkcontainer.h:35, from /usr/include/gtk-2.0/gtk/gtkbin.h:35, from /usr/include/gtk-2.0/gtk/gtkwindow.h:36, from /usr/include/gtk-2.0/gtk/gtkdialog.h:35, from /usr/include/gtk-2.0/gtk/gtkaboutdialog.h:32, from /usr/include/gtk-2.0/gtk/gtk.h:33, from gui.c:82: /usr/include/gtk-2.0/gtk/gtktypeutils.h:236:1: warning: ‘GTypeDebugFlags’ is deprecated [-Wdeprecated-declarations] 236 | void gtk_type_init (GTypeDebugFlags debug_flags); | ^~~~ In file included from /usr/include/glib-2.0/gobject/gobject.h:24, from /usr/include/glib-2.0/gobject/gbinding.h:29, from /usr/include/glib-2.0/glib-object.h:23, from /usr/include/glib-2.0/gio/gioenums.h:28, from /usr/include/glib-2.0/gio/giotypes.h:28, from /usr/include/glib-2.0/gio/gio.h:26, from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30, from /usr/include/gtk-2.0/gdk/gdk.h:32, from /usr/include/gtk-2.0/gtk/gtk.h:32, from gui.c:82: /usr/include/glib-2.0/gobject/gtype.h:677:1: note: declared here 677 | { | ^ --- p2v/gui.c | 1 + p2v/main.c | 1 + 2 files changed, 2 insertions(+) diff --git a/p2v/gui.c b/p2v/gui.c index 32c56dda7..a15ea053e 100644 --- a/p2v/gui.c +++ b/p2v/gui.c @@ -76,6 +76,7 @@ /* errors in <gtk.h> */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-prototypes" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #if defined(__GNUC__) && __GNUC__ >= 6 /* gcc >= 6 */ #pragma GCC diagnostic ignored "-Wshift-overflow" #endif diff --git a/p2v/main.c b/p2v/main.c index 424bccfb3..150037517 100644 --- a/p2v/main.c +++ b/p2v/main.c @@ -43,6 +43,7 @@ /* errors in <gtk.h> */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-prototypes" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #if defined(__GNUC__) && __GNUC__ >= 6 /* gcc >= 6 */ #pragma GCC diagnostic ignored "-Wshift-overflow" #endif -- 2.23.0
Pino Toscano
2019-Aug-30 10:35 UTC
Re: [Libguestfs] [PATCH] p2v: Ignore gtk2 deprecated declarations.
On Thursday, 29 August 2019 20:14:01 CEST Richard W.M. Jones wrote:> On latest Gtk2 the following warnings in main.c and gui.c cause the > build to fail if warn-error is enabled. > > In file included from /usr/include/gtk-2.0/gtk/gtkobject.h:37, > from /usr/include/gtk-2.0/gtk/gtkwidget.h:36, > from /usr/include/gtk-2.0/gtk/gtkcontainer.h:35, > from /usr/include/gtk-2.0/gtk/gtkbin.h:35, > from /usr/include/gtk-2.0/gtk/gtkwindow.h:36, > from /usr/include/gtk-2.0/gtk/gtkdialog.h:35, > from /usr/include/gtk-2.0/gtk/gtkaboutdialog.h:32, > from /usr/include/gtk-2.0/gtk/gtk.h:33, > from gui.c:82: > /usr/include/gtk-2.0/gtk/gtktypeutils.h:236:1: warning: ‘GTypeDebugFlags’ is deprecated [-Wdeprecated-declarations] > 236 | void gtk_type_init (GTypeDebugFlags debug_flags); > | ^~~~ > In file included from /usr/include/glib-2.0/gobject/gobject.h:24, > from /usr/include/glib-2.0/gobject/gbinding.h:29, > from /usr/include/glib-2.0/glib-object.h:23, > from /usr/include/glib-2.0/gio/gioenums.h:28, > from /usr/include/glib-2.0/gio/giotypes.h:28, > from /usr/include/glib-2.0/gio/gio.h:26, > from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30, > from /usr/include/gtk-2.0/gdk/gdk.h:32, > from /usr/include/gtk-2.0/gtk/gtk.h:32, > from gui.c:82: > /usr/include/glib-2.0/gobject/gtype.h:677:1: note: declared here > 677 | { > | ^Hmm they come from GTK headers directly, and the reported bits are only in deprecated sections of API... most probably we can just disable deprecated GTK stuff. I just send an alternative patch series for this, can you please check it? Thanks, -- Pino Toscano