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

Pekka Paalanen ppaalanen at gmail.com
Wed Nov 12 04:15:05 PST 2014


On Sat,  4 Oct 2014 20:37:13 +0900
Ryo Munakata <ryomnktml at 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 at 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) {



More information about the wayland-devel mailing list