GNOME Bugzilla – Bug 742488
make check fails because g_type_init() is deprecated
Last modified: 2017-05-06 19:00:57 UTC
Created attachment 293989 [details] [review] g_type_init() is deprecated $ make check ... calendar-test.c:20:9: error: ‘g_type_init’ is deprecated (declared at /usr/include/glib-2.0/gobject/gtype.h:679) [-Werror=deprecated-declarations] cc1: all warnings being treated as errors g_type_init() is deprecated. It does nothing but refraining me from testing planner.
Comment on attachment 293989 [details] [review] g_type_init() is deprecated >diff --git a/docs/libplanner/Makefile.am b/docs/libplanner/Makefile.am >index d4d655d..51b6f1f 100644 >--- a/docs/libplanner/Makefile.am >+++ b/docs/libplanner/Makefile.am >@@ -10,7 +10,7 @@ DOC_MAIN_SGML_FILE=libplanner-docs.sgml > DOC_SOURCE_DIR=../../libplanner > > # Extra options to pass to gtkdoc-scangobj >-SCANGOBJ_OPTIONS=--type-init-func="g_type_init()" >+SCANGOBJ_OPTIONS= > > # Extra options to supply to gtkdoc-scan > #SCAN_OPTIONS=--deprecated-guards="GTK_ENABLE_BROKEN|GTK_DISABLE_DEPRECATED" >diff --git a/src/Makefile.am b/src/Makefile.am >index 7191da2..538583b 100644 >diff --git a/tests/calendar-test.c b/tests/calendar-test.c >index fa8c4ba..ac77200 100644 >--- a/tests/calendar-test.c >+++ b/tests/calendar-test.c >@@ -17,8 +17,6 @@ main (gint argc, gchar **argv) > MrpDay *day_a, *day_b, *day_c, *def_1_id; > GList *l = NULL; > >- g_type_init (); >- > app = mrp_application_new (); > > project = mrp_project_new (NULL); >diff --git a/tests/cmd-manager-test.c b/tests/cmd-manager-test.c >index 6b463b0..863b1c4 100644 >--- a/tests/cmd-manager-test.c >+++ b/tests/cmd-manager-test.c >@@ -119,8 +119,6 @@ main (gint argc, gchar **argv) > { > ActionHistory action_history; > >- g_type_init (); >- > PlannerCmdManager *cmd_manager = planner_cmd_manager_new (); > > /* Initialise the action history */ >diff --git a/tests/scheduler-test.c b/tests/scheduler-test.c >index ec185de..4bdab4b 100644 >--- a/tests/scheduler-test.c >+++ b/tests/scheduler-test.c >@@ -227,8 +227,6 @@ main (gint argc, gchar **argv) > NULL > }; > >- g_type_init (); >- > app = mrp_application_new (); > > i = 0; >diff --git a/tests/task-test.c b/tests/task-test.c >index ab9c191..b93c9d8 100644 >--- a/tests/task-test.c >+++ b/tests/task-test.c >@@ -21,8 +21,6 @@ main (gint argc, gchar **argv) > MrpTask *root; > MrpRelation *relation; > >- g_type_init (); >- > app = mrp_application_new (); > > project_start = mrp_time_from_string ("20020218", NULL);
The real problem is not g_type_init() but the way we are handling warnings. If we do it the Gnome way, make check works... See: bug 703067. Warning appear on the console. They will be fixed.
No surprise, this bug reappears : bug 782227. This bug has to be resolved. It should have been. Patches exist.
The solution proposed here is a more rough one -- it simply removes the `g_type_init` call(s), instead of wrapping it into an if-macro performing the version check.
*** This bug has been marked as a duplicate of bug 782227 ***