Bug #3792

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

Added by Igor Kozhukhov over 2 years ago. Updated 5 months ago.

Status:ClosedStart date:2013-05-27
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:cmd - userland programs
Target version:-
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]

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

History

#1 Updated by Igor Kozhukhov over 2 years ago

  • % Done changed from 80 to 100
  • Status changed from In Progress to Feedback
  • File 3792_il.patchMagnifier added

attached patch for this issue.

#2 Updated by Peter Tribble about 2 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 2 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 2 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 5 months 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 5 months ago

  • Assignee deleted (Igor Kozhukhov)

#7 Updated by Electric Monk 5 months 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