GNOME Bugzilla – Bug 772029
Unecessary "deprecation" warning
Last modified: 2018-05-02 17:34:00 UTC
Created attachment 336310 [details] testcase for the compiler warnings. I'm trying to build AbiWord with proper warnings and Gtk version. So I pass "-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_12 -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_12" to the compiler (3.12 is our baseline version). And it generates warning about a class I don't use that appeared in 3.20. % gcc `pkg-config --cflags gtk+-3.0` -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_12 -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_12 -Wextra -Wall gtkversion.cpp In file included from /usr/include/glib-2.0/gobject/gobject.h:24:0, 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-3.0/gdk/gdkapplaunchcontext.h:28, from /usr/include/gtk-3.0/gdk/gdk.h:32, from /usr/include/gtk-3.0/gtk/gtk.h:30, from gtkversion.cpp:2: /usr/include/gtk-3.0/gtk/gtknativedialog.h: In function ‘GtkNativeDialog* GTK_NATIVE_DIALOG(gpointer)’: /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:44: warning: ‘GType gtk_native_dialog_get_type()’ is deprecated: Not available before 3.20 [-Wdeprecated-declarations] G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^ /usr/include/glib-2.0/gobject/gtype.h:2207:61: note: in definition of macro ‘_G_TYPE_CIC’ ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) ^~ /usr/include/glib-2.0/gobject/gtype.h:1490:12: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_CAST’ return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \ ^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:1: note: in expansion of macro ‘G_DECLARE_DERIVABLE_TYPE’ G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:44: note: declared here G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^ /usr/include/glib-2.0/gobject/gtype.h:1481:9: note: in definition of macro ‘G_DECLARE_DERIVABLE_TYPE’ GType module_obj_name##_get_type (void); \ ^~~~~~~~~~~~~~~ /usr/include/glib-2.0/gobject/gtype.h:1490:73: warning: ‘GType gtk_native_dialog_get_type()’ is deprecated: Not available before 3.20 [-Wdeprecated-declarations] return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \ ^ /usr/include/glib-2.0/gobject/gtype.h:2207:61: note: in definition of macro ‘_G_TYPE_CIC’ ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) ^~ /usr/include/glib-2.0/gobject/gtype.h:1490:12: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_CAST’ return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \ ^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:1: note: in expansion of macro ‘G_DECLARE_DERIVABLE_TYPE’ G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:44: note: declared here G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^ /usr/include/glib-2.0/gobject/gtype.h:1481:9: note: in definition of macro ‘G_DECLARE_DERIVABLE_TYPE’ GType module_obj_name##_get_type (void); \ ^~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h: In function ‘GtkNativeDialogClass* GTK_NATIVE_DIALOG_CLASS(gpointer)’: /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:44: warning: ‘GType gtk_native_dialog_get_type()’ is deprecated: Not available before 3.20 [-Wdeprecated-declarations] G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^ /usr/include/glib-2.0/gobject/gtype.h:2209:55: note: in definition of macro ‘_G_TYPE_CCC’ ((ct*) g_type_check_class_cast ((GTypeClass*) cp, gt)) ^~ /usr/include/glib-2.0/gobject/gtype.h:1492:12: note: in expansion of macro ‘G_TYPE_CHECK_CLASS_CAST’ return G_TYPE_CHECK_CLASS_CAST (ptr, module_obj_name##_get_type (), ModuleObjName##Class); } \ ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:1: note: in expansion of macro ‘G_DECLARE_DERIVABLE_TYPE’ G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:44: note: declared here G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^ /usr/include/glib-2.0/gobject/gtype.h:1481:9: note: in definition of macro ‘G_DECLARE_DERIVABLE_TYPE’ GType module_obj_name##_get_type (void); \ ^~~~~~~~~~~~~~~ /usr/include/glib-2.0/gobject/gtype.h:1492:70: warning: ‘GType gtk_native_dialog_get_type()’ is deprecated: Not available before 3.20 [-Wdeprecated-declarations] return G_TYPE_CHECK_CLASS_CAST (ptr, module_obj_name##_get_type (), ModuleObjName##Class); } \ ^ /usr/include/glib-2.0/gobject/gtype.h:2209:55: note: in definition of macro ‘_G_TYPE_CCC’ ((ct*) g_type_check_class_cast ((GTypeClass*) cp, gt)) ^~ /usr/include/glib-2.0/gobject/gtype.h:1492:12: note: in expansion of macro ‘G_TYPE_CHECK_CLASS_CAST’ return G_TYPE_CHECK_CLASS_CAST (ptr, module_obj_name##_get_type (), ModuleObjName##Class); } \ ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:1: note: in expansion of macro ‘G_DECLARE_DERIVABLE_TYPE’ G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:44: note: declared here G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^ /usr/include/glib-2.0/gobject/gtype.h:1481:9: note: in definition of macro ‘G_DECLARE_DERIVABLE_TYPE’ GType module_obj_name##_get_type (void); \ ^~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h: In function ‘gboolean GTK_IS_NATIVE_DIALOG(gpointer)’: /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:44: warning: ‘GType gtk_native_dialog_get_type()’ is deprecated: Not available before 3.20 [-Wdeprecated-declarations] G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^ /usr/include/glib-2.0/gobject/gtype.h:2221:60: note: in definition of macro ‘_G_TYPE_CIT’ GTypeInstance *__inst = (GTypeInstance*) ip; GType __t = gt; gboolean __r; \ ^~ /usr/include/glib-2.0/gobject/gtype.h:1494:12: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’ return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \ ^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:1: note: in expansion of macro ‘G_DECLARE_DERIVABLE_TYPE’ G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:44: note: declared here G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^ /usr/include/glib-2.0/gobject/gtype.h:1481:9: note: in definition of macro ‘G_DECLARE_DERIVABLE_TYPE’ GType module_obj_name##_get_type (void); \ ^~~~~~~~~~~~~~~ /usr/include/glib-2.0/gobject/gtype.h:1494:73: warning: ‘GType gtk_native_dialog_get_type()’ is deprecated: Not available before 3.20 [-Wdeprecated-declarations] return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \ ^ /usr/include/glib-2.0/gobject/gtype.h:2221:60: note: in definition of macro ‘_G_TYPE_CIT’ GTypeInstance *__inst = (GTypeInstance*) ip; GType __t = gt; gboolean __r; \ ^~ /usr/include/glib-2.0/gobject/gtype.h:1494:12: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’ return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \ ^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:1: note: in expansion of macro ‘G_DECLARE_DERIVABLE_TYPE’ G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:44: note: declared here G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^ /usr/include/glib-2.0/gobject/gtype.h:1481:9: note: in definition of macro ‘G_DECLARE_DERIVABLE_TYPE’ GType module_obj_name##_get_type (void); \ ^~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h: In function ‘gboolean GTK_IS_NATIVE_DIALOG_CLASS(gpointer)’: /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:44: warning: ‘GType gtk_native_dialog_get_type()’ is deprecated: Not available before 3.20 [-Wdeprecated-declarations] G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^ /usr/include/glib-2.0/gobject/gtype.h:2231:55: note: in definition of macro ‘_G_TYPE_CCT’ GTypeClass *__class = (GTypeClass*) cp; GType __t = gt; gboolean __r; \ ^~ /usr/include/glib-2.0/gobject/gtype.h:1496:12: note: in expansion of macro ‘G_TYPE_CHECK_CLASS_TYPE’ return G_TYPE_CHECK_CLASS_TYPE (ptr, module_obj_name##_get_type ()); } \ ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:1: note: in expansion of macro ‘G_DECLARE_DERIVABLE_TYPE’ G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:44: note: declared here G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^ /usr/include/glib-2.0/gobject/gtype.h:1481:9: note: in definition of macro ‘G_DECLARE_DERIVABLE_TYPE’ GType module_obj_name##_get_type (void); \ ^~~~~~~~~~~~~~~ /usr/include/glib-2.0/gobject/gtype.h:1496:70: warning: ‘GType gtk_native_dialog_get_type()’ is deprecated: Not available before 3.20 [-Wdeprecated-declarations] return G_TYPE_CHECK_CLASS_TYPE (ptr, module_obj_name##_get_type ()); } \ ^ /usr/include/glib-2.0/gobject/gtype.h:2231:55: note: in definition of macro ‘_G_TYPE_CCT’ GTypeClass *__class = (GTypeClass*) cp; GType __t = gt; gboolean __r; \ ^~ /usr/include/glib-2.0/gobject/gtype.h:1496:12: note: in expansion of macro ‘G_TYPE_CHECK_CLASS_TYPE’ return G_TYPE_CHECK_CLASS_TYPE (ptr, module_obj_name##_get_type ()); } \ ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:1: note: in expansion of macro ‘G_DECLARE_DERIVABLE_TYPE’ G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtknativedialog.h:33:44: note: declared here G_DECLARE_DERIVABLE_TYPE (GtkNativeDialog, gtk_native_dialog, GTK, NATIVE_DIALOG, GObject) ^ /usr/include/glib-2.0/gobject/gtype.h:1481:9: note: in definition of macro ‘G_DECLARE_DERIVABLE_TYPE’ GType module_obj_name##_get_type (void); \ ^~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtkfilechoosernative.h: In function ‘GtkFileChooserNative* GTK_FILE_CHOOSER_NATIVE(gpointer)’: /usr/include/gtk-3.0/gtk/gtkfilechoosernative.h:34:45: warning: ‘GType gtk_file_chooser_native_get_type()’ is deprecated: Not available before 3.20 [-Wdeprecated-declarations] G_DECLARE_FINAL_TYPE (GtkFileChooserNative, gtk_file_chooser_native, GTK, FILE_CHOOSER_NATIVE, GtkNativeDialog) ^ /usr/include/glib-2.0/gobject/gtype.h:2207:61: note: in definition of macro ‘_G_TYPE_CIC’ ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) ^~ /usr/include/glib-2.0/gobject/gtype.h:1399:12: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_CAST’ return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \ ^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtkfilechoosernative.h:34:1: note: in expansion of macro ‘G_DECLARE_FINAL_TYPE’ G_DECLARE_FINAL_TYPE (GtkFileChooserNative, gtk_file_chooser_native, GTK, FILE_CHOOSER_NATIVE, GtkNativeDialog) ^~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtkfilechoosernative.h:34:45: note: declared here G_DECLARE_FINAL_TYPE (GtkFileChooserNative, gtk_file_chooser_native, GTK, FILE_CHOOSER_NATIVE, GtkNativeDialog) ^ /usr/include/glib-2.0/gobject/gtype.h:1391:9: note: in definition of macro ‘G_DECLARE_FINAL_TYPE’ GType module_obj_name##_get_type (void); \ ^~~~~~~~~~~~~~~ /usr/include/glib-2.0/gobject/gtype.h:1399:73: warning: ‘GType gtk_file_chooser_native_get_type()’ is deprecated: Not available before 3.20 [-Wdeprecated-declarations] return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \ ^ /usr/include/glib-2.0/gobject/gtype.h:2207:61: note: in definition of macro ‘_G_TYPE_CIC’ ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) ^~ /usr/include/glib-2.0/gobject/gtype.h:1399:12: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_CAST’ return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \ ^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtkfilechoosernative.h:34:1: note: in expansion of macro ‘G_DECLARE_FINAL_TYPE’ G_DECLARE_FINAL_TYPE (GtkFileChooserNative, gtk_file_chooser_native, GTK, FILE_CHOOSER_NATIVE, GtkNativeDialog) ^~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtkfilechoosernative.h:34:45: note: declared here G_DECLARE_FINAL_TYPE (GtkFileChooserNative, gtk_file_chooser_native, GTK, FILE_CHOOSER_NATIVE, GtkNativeDialog) ^ /usr/include/glib-2.0/gobject/gtype.h:1391:9: note: in definition of macro ‘G_DECLARE_FINAL_TYPE’ GType module_obj_name##_get_type (void); \ ^~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtkfilechoosernative.h: In function ‘gboolean GTK_IS_FILE_CHOOSER_NATIVE(gpointer)’: /usr/include/gtk-3.0/gtk/gtkfilechoosernative.h:34:45: warning: ‘GType gtk_file_chooser_native_get_type()’ is deprecated: Not available before 3.20 [-Wdeprecated-declarations] G_DECLARE_FINAL_TYPE (GtkFileChooserNative, gtk_file_chooser_native, GTK, FILE_CHOOSER_NATIVE, GtkNativeDialog) ^ /usr/include/glib-2.0/gobject/gtype.h:2221:60: note: in definition of macro ‘_G_TYPE_CIT’ GTypeInstance *__inst = (GTypeInstance*) ip; GType __t = gt; gboolean __r; \ ^~ /usr/include/glib-2.0/gobject/gtype.h:1401:12: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’ return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \ ^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtkfilechoosernative.h:34:1: note: in expansion of macro ‘G_DECLARE_FINAL_TYPE’ G_DECLARE_FINAL_TYPE (GtkFileChooserNative, gtk_file_chooser_native, GTK, FILE_CHOOSER_NATIVE, GtkNativeDialog) ^~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtkfilechoosernative.h:34:45: note: declared here G_DECLARE_FINAL_TYPE (GtkFileChooserNative, gtk_file_chooser_native, GTK, FILE_CHOOSER_NATIVE, GtkNativeDialog) ^ /usr/include/glib-2.0/gobject/gtype.h:1391:9: note: in definition of macro ‘G_DECLARE_FINAL_TYPE’ GType module_obj_name##_get_type (void); \ ^~~~~~~~~~~~~~~ /usr/include/glib-2.0/gobject/gtype.h:1401:73: warning: ‘GType gtk_file_chooser_native_get_type()’ is deprecated: Not available before 3.20 [-Wdeprecated-declarations] return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \ ^ /usr/include/glib-2.0/gobject/gtype.h:2221:60: note: in definition of macro ‘_G_TYPE_CIT’ GTypeInstance *__inst = (GTypeInstance*) ip; GType __t = gt; gboolean __r; \ ^~ /usr/include/glib-2.0/gobject/gtype.h:1401:12: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_TYPE’ return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \ ^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtkfilechoosernative.h:34:1: note: in expansion of macro ‘G_DECLARE_FINAL_TYPE’ G_DECLARE_FINAL_TYPE (GtkFileChooserNative, gtk_file_chooser_native, GTK, FILE_CHOOSER_NATIVE, GtkNativeDialog) ^~~~~~~~~~~~~~~~~~~~ /usr/include/gtk-3.0/gtk/gtkfilechoosernative.h:34:45: note: declared here G_DECLARE_FINAL_TYPE (GtkFileChooserNative, gtk_file_chooser_native, GTK, FILE_CHOOSER_NATIVE, GtkNativeDialog) ^ /usr/include/glib-2.0/gobject/gtype.h:1391:9: note: in definition of macro ‘G_DECLARE_FINAL_TYPE’ GType module_obj_name##_get_type (void); \ ^~~~~~~~~~~~~~~ This make just building with warning useless. Building in "C" mode doesn't do the warnings. Attached is the example.
Version information Name : gtk3-devel Version : 3.20.9 Release : 1.fc24 Architecture: x86_64
Which compiler is this? We use the "ignore deprecation warnings" pragma around the declarations that may use the get_type() function.
gcc (GCC) 6.2.1 20160916 (Red Hat 6.2.1-2) Name : gcc-c++ Version : 6.2.1 Release : 2.fc24 Architecture: x86_64 Install Date: Wed 21 Sep 2016 11:28:36 PM EDT Now I'm wondering if that's not a regression in the compiler as it didn't happen earlier.
Confirming it is not the compiler version. Name : gcc-c++ Version : 6.1.1 Release : 2.fc24 Architecture: x86_64 Still happening.
Is this still occurring?
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/677.