openhpi2 / Open-HPI

Open HPI is an open source implementation of the SA Forum's Hardware Platform Interface (HPI). HPI provides an abstracted interface to managing computer hardware, typically for chassis and rack based servers
Other
3 stars 1 forks source link

gcc 4.7 compiler warning in soap plugin #2519

Closed openhpi2 closed 8 years ago

openhpi2 commented 10 years ago

OS version:

cat /etc/issue

Red Hat Enterprise Linux Server release 7.0 Alpha3 (Maipo)

Compiler version: gcc version 4.7.2 20121109 (Red Hat 4.7.2-8) (GCC)

compiler warning with soap plugin:

oa_soap.c: In function 'build_oa_soap_custom_handler': oa_soap.c:123:17: warning: 'g_mutex_new' is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:271) [-Wdeprecated-declarations] oa_soap.c:153:17: warning: 'g_mutex_new' is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:271) [-Wdeprecated-declarations] oa_soap.c:163:17: warning: 'g_mutex_new' is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:271) [-Wdeprecated-declarations] oa_soap.c: In function 'oa_soap_close': oa_soap.c:355:4: warning: 'g_mutex_free' is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:273) [-Wdeprecated-declarations] oa_soap.c:366:4: warning: 'g_mutex_free' is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:273) [-Wdeprecated-declarations] oa_soap.c:377:4: warning: 'g_mutex_free' is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:273) [-Wdeprecated-declarations] oa_soap_utils.c: In function 'oa_soap_get_oa_ip': oa_soap_utils.c:1725:36: warning: the comparison will always evaluate as 'false' for the address of 'network_info_response' will never be NULL [-Waddress] oa_soap_discover.c: In function 'oa_soap_discover_resources': oa_soap_discover.c:291:25: warning: 'g_thread_create' is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:100): Use 'g_thread_new' instead [-Wdeprecated-declarations] oa_soap_discover.c:312:25: warning: 'g_thread_create' is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:100): Use 'g_thread_new' instead [-Wdeprecated-declarations]

Reported by: hemanthreddy

openhpi2 commented 10 years ago

https://mail.gnome.org/archives/networkmanager-list/2011-October/msg00280.html says Starting in glib 2.31 the following calls are replaced. GMutex *foo;
foo = g_mutex_new () is replaced with g_mutex_init (foo); g_mutex_free(foo) is replaced with g_mutex_clear(foo);

We need to change it and see if it works in older releases like RHEL 4.* and SLES 8.*

Original comment by: dr_mohan

openhpi2 commented 10 years ago

Diff:


--- old
+++ new
@@ -1,4 +1,3 @@
-
 OS version:
 # cat /etc/issue
 Red Hat Enterprise Linux Server release 7.0 Alpha3 (Maipo)

Original comment by: dr_mohan

openhpi2 commented 10 years ago

Fixed with checkin #7593

Original comment by: dr_mohan