Bug #3792

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

Added by Igor Kozhukhov almost 2 years ago. Updated 32 minutes ago.

Status:Feedback Start date:2013-05-27
Priority:Normal Due 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 (777 Bytes) Igor Kozhukhov, 05/27/2013 08:54 pm

History

Updated by Igor Kozhukhov almost 2 years ago

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

attached patch for this issue.

Updated by Peter Tribble almost 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.

Updated by Igor Kozhukhov almost 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.

Updated by Peter Tribble almost 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.

Updated by Alexander Pyhalov 39 minutes 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/

Updated by Igor Kozhukhov 32 minutes ago

  • Assignee deleted (Igor Kozhukhov)

Also available in: Atom PDF