A colleague here was just installed the new Fedora Core 5 release on a
machine, and this has caused a heartbeat compilation warning->error:

   cc1: warnings being treated as errors
   ../../../lib/lrm/clientlib.c: In function 'rsc_get_cur_state':
   ../../../lib/lrm/clientlib.c:1017: warning: ignoring return value of 
'g_list_sort', declared with attribute warn_unused_result
   make: *** [liblrm_la-clientlib.lo] Error 1

This machine also has gcc 4.1.0, but I suspect this is not the issue.
Rather I suspect a subtle change in "/usr/include/glib-2.0/glib/glist.h"
header file from:

   GList*   g_list_sort           (GList            *list,
                                   GCompareFunc      compare_func);

to:

   GList*   g_list_sort                    (GList            *list,
                                            GCompareFunc      compare_func) 
G_GNUC_WARN_UNUSED_RESULT;

A quick test casting the use of this (clientlib.c:1017) to "(void)"
doesn't fix it.  (I don't like casts anyway, so I'm not disappointed that
this failed!)

My guess (being unfamiliar with "glib" details) is that the result of this
call is vital: that there is (I guess) little (no?) point in calling this
routine if the result isn't used.  (Correct?)

So the proper fix would seem to be either to use the result or, if the
sort operation doesn't need to be done, not to call it at all.

Could someone who knows this code investigate, please?

-- 

:  David Lee                                I.T. Service          :
:  Senior Systems Programmer                Computer Centre       :
:                                           Durham University     :
:  http://www.dur.ac.uk/t.d.lee/            South Road            :
:                                           Durham DH1 3LE        :
:  Phone: +44 191 334 2752                  U.K.                  :
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to