Project

General

Profile

Bug #3792

hald.c:371: error: 'g_type_init' is deprecated

Added by Igor Kozhukhov about 6 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
cmd - userland programs
Start date:
2013-05-27
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage

Description

after upgrade glib to 2.36.1 we have error:
hald.c:371: error: 'g_type_init' is deprecated (declared at /usr/include/glib-2.0/gobject/gtype.h:669) [-Wdeprecated-declarations]


Files

3792_il.patch (777 Bytes) 3792_il.patch Igor Kozhukhov, 2013-05-27 08:54 PM

History

#1

Updated by Igor Kozhukhov about 6 years ago

attached patch for this issue.

#2

Updated by Peter Tribble about 6 years ago

That initial patch isn't quite right. The check for GLIB_MICRO_VERSION shouldn't be there. Just:

#if (GLIB_MAJOR_VERSION <= 2 && GLIB_MINOR_VERSION < 36)

ought to do it.

#3

Updated by Igor Kozhukhov about 6 years ago

it is working well fro me with glib-2.36.1
i found info that this interface have been changes from glib-2.35.0

Peter Tribble wrote:

That initial patch isn't quite right. The check for GLIB_MICRO_VERSION shouldn't be there. Just:

#if (GLIB_MAJOR_VERSION <= 2 && GLIB_MINOR_VERSION < 36)

ought to do it.

#4

Updated by Peter Tribble about 6 years ago

Igor Kozhukhov wrote:

it is working well fro me with glib-2.36.1

Yes, but try with an older version such as 2.34.3, for example - which should call g_type_init() and wouldn't as you require GLIB_MICRO_VERSION to be zero.

i found info that this interface have been changes from glib-2.35.0

Indeed; as in removed.

Peter Tribble wrote:

That initial patch isn't quite right. The check for GLIB_MICRO_VERSION shouldn't be there. Just:

#if (GLIB_MAJOR_VERSION <= 2 && GLIB_MINOR_VERSION < 36)

ought to do it.

#5

Updated by Alexander Pyhalov over 4 years ago

I've looked at glib code and confirmed that change was done when glib version was 2.35.0.
So the correct fix is to use

#if !GLIB_CHECK_VERSION(2,35,0)
         g_type_init ();
#endif

Webrev is here: http://cr.illumos.org/~webrev/alp/

#6

Updated by Igor Kozhukhov over 4 years ago

  • Assignee deleted (Igor Kozhukhov)
#7

Updated by Electric Monk over 4 years ago

  • Status changed from Feedback to Closed

git commit 61f847aff0d91f3c0fc439c66e00704c78fecd84

commit  61f847aff0d91f3c0fc439c66e00704c78fecd84
Author: Alexander Pyhalov <apyhalov@gmail.com>
Date:   2015-03-27T14:48:31.000Z

    3792 hald.c:371: error: 'g_type_init' is deprecated
    Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
    Reviewed by: Jon Tibble <meths@btinternet.com>
    Reviewed by: Peter Tribble <peter.tribble@gmail.com>
    Approved by: Dan McDonald <danmcd@omniti.com>

Also available in: Atom PDF