[weston,v2,2/2] Avoid 'g_type_init() is deprecated' warnings

Submitted by Ryo Munakata on Oct. 4, 2014, 11:37 a.m.

Details

Message ID 1412422633-3728-3-git-send-email-ryomnktml@gmail.com
State Changes Requested
Headers show

Not browsing as part of any series.

Commit Message

Ryo Munakata Oct. 4, 2014, 11:37 a.m.
Because of g_type_init we see the following:
clients/editor.c:1350:2: warning: ‘g_type_init’ is deprecated (declared
at /usr/include/glib-2.0/gobject/gtype.h:679)
[-Wdeprecated-declarations]

g_type_init() has been deprecated and does nothing
since version GLib 2.36.

Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
---
 clients/editor.c   | 2 ++
 clients/stacking.c | 2 ++
 2 files changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/clients/editor.c b/clients/editor.c
index 421f8fe..87bf68f 100644
--- a/clients/editor.c
+++ b/clients/editor.c
@@ -1347,8 +1347,10 @@  main(int argc, char *argv[])
 	memset(&editor, 0, sizeof editor);
 
 #ifdef HAVE_PANGO
+#if !GLIB_CHECK_VERSION(2,36,0)
 	g_type_init();
 #endif
+#endif
 
 	editor.display = display_create(&argc, argv);
 	if (editor.display == NULL) {
diff --git a/clients/stacking.c b/clients/stacking.c
index ea6101d..99f2b1f 100644
--- a/clients/stacking.c
+++ b/clients/stacking.c
@@ -289,8 +289,10 @@  main(int argc, char *argv[])
 	memset(&stacking, 0, sizeof stacking);
 
 #ifdef HAVE_PANGO
+#if !GLIB_CHECK_VERSION(2,36,0)
 	g_type_init();
 #endif
+#endif
 
 	stacking.display = display_create(&argc, argv);
 	if (stacking.display == NULL) {

Comments

On Sat,  4 Oct 2014 20:37:13 +0900
Ryo Munakata <ryomnktml@gmail.com> wrote:

> Because of g_type_init we see the following:
> clients/editor.c:1350:2: warning: ‘g_type_init’ is deprecated (declared
> at /usr/include/glib-2.0/gobject/gtype.h:679)
> [-Wdeprecated-declarations]
> 
> g_type_init() has been deprecated and does nothing
> since version GLib 2.36.

Hmm, I have glib 2.40 and I don't see the warning.

Is a build-time check correct here, though?
Should we be setting GLIB_VERSION_MIN_REQUIRED?

What if this is built against a new glib, but ran against an old glib,
is that something we should ever worry about?

btw. there is also a third g_type_init() in src/cms-colord.c.


Thanks,
pq

> Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
> ---
>  clients/editor.c   | 2 ++
>  clients/stacking.c | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/clients/editor.c b/clients/editor.c
> index 421f8fe..87bf68f 100644
> --- a/clients/editor.c
> +++ b/clients/editor.c
> @@ -1347,8 +1347,10 @@ main(int argc, char *argv[])
>  	memset(&editor, 0, sizeof editor);
>  
>  #ifdef HAVE_PANGO
> +#if !GLIB_CHECK_VERSION(2,36,0)
>  	g_type_init();
>  #endif
> +#endif
>  
>  	editor.display = display_create(&argc, argv);
>  	if (editor.display == NULL) {
> diff --git a/clients/stacking.c b/clients/stacking.c
> index ea6101d..99f2b1f 100644
> --- a/clients/stacking.c
> +++ b/clients/stacking.c
> @@ -289,8 +289,10 @@ main(int argc, char *argv[])
>  	memset(&stacking, 0, sizeof stacking);
>  
>  #ifdef HAVE_PANGO
> +#if !GLIB_CHECK_VERSION(2,36,0)
>  	g_type_init();
>  #endif
> +#endif
>  
>  	stacking.display = display_create(&argc, argv);
>  	if (stacking.display == NULL) {