[libvirt] [libvirt-cim][PATCH] list_util.h: Drop inline modifiers

There's no need to mark a function as inline in the function declaration. In fact, it causes a compilation error: CC xmlgen.lo In file included from acl_parsing.h:29:0, from xmlgen.h:26, from capability_parsing.c:37: list_util.h:67:21: error: inline function ‘list_node_prev_node’ declared but never defined [-Werror] inline list_node_t *list_node_prev_node(list_node_t *node); ^ list_util.h:66:14: error: inline function ‘list_node_prev’ declared but never defined [-Werror] inline void *list_node_prev(list_node_t *node); ^ list_util.h:64:21: error: inline function ‘list_node_next_node’ declared but never defined [-Werror] inline list_node_t *list_node_next_node(list_node_t *node); ^ list_util.h:63:14: error: inline function ‘list_node_next’ declared but never defined [-Werror] inline void *list_node_next(list_node_t *node); ^ list_util.h:61:21: error: inline function ‘list_last_node’ declared but never defined [-Werror] inline list_node_t *list_last_node(list_t *list); ^ list_util.h:60:14: error: inline function ‘list_last’ declared but never defined [-Werror] inline void *list_last(list_t *list); ^ list_util.h:58:21: error: inline function ‘list_first_node’ declared but never defined [-Werror] inline list_node_t *list_first_node(list_t *list); ^ list_util.h:57:14: error: inline function ‘list_first’ declared but never defined [-Werror] inline void *list_first(list_t *list); ^ list_util.h:55:13: error: inline function ‘list_node_data_set’ declared but never defined [-Werror] inline void list_node_data_set(list_node_t *node, void *data); ^ list_util.h:54:14: error: inline function ‘list_node_data_get’ declared but never defined [-Werror] inline void *list_node_data_get(list_node_t *node); ^ list_util.h:52:21: error: inline function ‘list_count’ declared but never defined [-Werror] inline unsigned int list_count(list_t *list); ^ cc1: all warnings being treated as errors Makefile:499: recipe for target 'capability_parsing.lo' failed make[2]: *** [capability_parsing.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- libxkutil/list_util.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libxkutil/list_util.h b/libxkutil/list_util.h index 6510272..6582dfe 100644 --- a/libxkutil/list_util.h +++ b/libxkutil/list_util.h @@ -49,22 +49,22 @@ void list_remove_node(list_t *list, list_node_t *node); bool list_foreach(list_t *list, list_foreach_cb cb, void *user_data); -inline unsigned int list_count(list_t *list); +unsigned int list_count(list_t *list); -inline void *list_node_data_get(list_node_t *node); -inline void list_node_data_set(list_node_t *node, void *data); +void *list_node_data_get(list_node_t *node); +void list_node_data_set(list_node_t *node, void *data); -inline void *list_first(list_t *list); -inline list_node_t *list_first_node(list_t *list); +void *list_first(list_t *list); +list_node_t *list_first_node(list_t *list); -inline void *list_last(list_t *list); -inline list_node_t *list_last_node(list_t *list); +void *list_last(list_t *list); +list_node_t *list_last_node(list_t *list); -inline void *list_node_next(list_node_t *node); -inline list_node_t *list_node_next_node(list_node_t *node); +void *list_node_next(list_node_t *node); +list_node_t *list_node_next_node(list_node_t *node); -inline void *list_node_prev(list_node_t *node); -inline list_node_t *list_node_prev_node(list_node_t *node); +void *list_node_prev(list_node_t *node); +list_node_t *list_node_prev_node(list_node_t *node); #ifdef __cplusplus } /* extern "C" */ -- 2.0.5

On 04/28/2015 07:58 AM, Michal Privoznik wrote:
There's no need to mark a function as inline in the function declaration. In fact, it causes a compilation error:
CC xmlgen.lo In file included from acl_parsing.h:29:0, from xmlgen.h:26, from capability_parsing.c:37: list_util.h:67:21: error: inline function ‘list_node_prev_node’ declared but never defined [-Werror] inline list_node_t *list_node_prev_node(list_node_t *node); ^ list_util.h:66:14: error: inline function ‘list_node_prev’ declared but never defined [-Werror] inline void *list_node_prev(list_node_t *node); ^ list_util.h:64:21: error: inline function ‘list_node_next_node’ declared but never defined [-Werror] inline list_node_t *list_node_next_node(list_node_t *node); ^ list_util.h:63:14: error: inline function ‘list_node_next’ declared but never defined [-Werror] inline void *list_node_next(list_node_t *node); ^ list_util.h:61:21: error: inline function ‘list_last_node’ declared but never defined [-Werror] inline list_node_t *list_last_node(list_t *list); ^ list_util.h:60:14: error: inline function ‘list_last’ declared but never defined [-Werror] inline void *list_last(list_t *list); ^ list_util.h:58:21: error: inline function ‘list_first_node’ declared but never defined [-Werror] inline list_node_t *list_first_node(list_t *list); ^ list_util.h:57:14: error: inline function ‘list_first’ declared but never defined [-Werror] inline void *list_first(list_t *list); ^ list_util.h:55:13: error: inline function ‘list_node_data_set’ declared but never defined [-Werror] inline void list_node_data_set(list_node_t *node, void *data); ^ list_util.h:54:14: error: inline function ‘list_node_data_get’ declared but never defined [-Werror] inline void *list_node_data_get(list_node_t *node); ^ list_util.h:52:21: error: inline function ‘list_count’ declared but never defined [-Werror] inline unsigned int list_count(list_t *list); ^ cc1: all warnings being treated as errors Makefile:499: recipe for target 'capability_parsing.lo' failed make[2]: *** [capability_parsing.lo] Error 1 make[2]: *** Waiting for unfinished jobs....
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- libxkutil/list_util.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
The last time I compiled libvirt-cim this wasn't an issue! Additionally my daily Coverity builds libvirt-cim from upstream from scratch without issue... So is this from a 'newer' compiler? I have: $ gcc --version gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6) Copyright (C) 2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. I'm not disagreeing this is a problem and needs to be fixed... John FWIW: libvirt-cim patches have been sent to the libvirt-cim list @libvirt-cim@redhat.com and not libvir-list...
diff --git a/libxkutil/list_util.h b/libxkutil/list_util.h index 6510272..6582dfe 100644 --- a/libxkutil/list_util.h +++ b/libxkutil/list_util.h @@ -49,22 +49,22 @@ void list_remove_node(list_t *list, list_node_t *node);
bool list_foreach(list_t *list, list_foreach_cb cb, void *user_data);
-inline unsigned int list_count(list_t *list); +unsigned int list_count(list_t *list);
-inline void *list_node_data_get(list_node_t *node); -inline void list_node_data_set(list_node_t *node, void *data); +void *list_node_data_get(list_node_t *node); +void list_node_data_set(list_node_t *node, void *data);
-inline void *list_first(list_t *list); -inline list_node_t *list_first_node(list_t *list); +void *list_first(list_t *list); +list_node_t *list_first_node(list_t *list);
-inline void *list_last(list_t *list); -inline list_node_t *list_last_node(list_t *list); +void *list_last(list_t *list); +list_node_t *list_last_node(list_t *list);
-inline void *list_node_next(list_node_t *node); -inline list_node_t *list_node_next_node(list_node_t *node); +void *list_node_next(list_node_t *node); +list_node_t *list_node_next_node(list_node_t *node);
-inline void *list_node_prev(list_node_t *node); -inline list_node_t *list_node_prev_node(list_node_t *node); +void *list_node_prev(list_node_t *node); +list_node_t *list_node_prev_node(list_node_t *node);
#ifdef __cplusplus } /* extern "C" */

On 28.04.2015 14:53, John Ferlan wrote:
On 04/28/2015 07:58 AM, Michal Privoznik wrote:
There's no need to mark a function as inline in the function declaration. In fact, it causes a compilation error:
CC xmlgen.lo In file included from acl_parsing.h:29:0, from xmlgen.h:26, from capability_parsing.c:37: list_util.h:67:21: error: inline function ‘list_node_prev_node’ declared but never defined [-Werror] inline list_node_t *list_node_prev_node(list_node_t *node); ^ list_util.h:66:14: error: inline function ‘list_node_prev’ declared but never defined [-Werror] inline void *list_node_prev(list_node_t *node); ^ list_util.h:64:21: error: inline function ‘list_node_next_node’ declared but never defined [-Werror] inline list_node_t *list_node_next_node(list_node_t *node); ^ list_util.h:63:14: error: inline function ‘list_node_next’ declared but never defined [-Werror] inline void *list_node_next(list_node_t *node); ^ list_util.h:61:21: error: inline function ‘list_last_node’ declared but never defined [-Werror] inline list_node_t *list_last_node(list_t *list); ^ list_util.h:60:14: error: inline function ‘list_last’ declared but never defined [-Werror] inline void *list_last(list_t *list); ^ list_util.h:58:21: error: inline function ‘list_first_node’ declared but never defined [-Werror] inline list_node_t *list_first_node(list_t *list); ^ list_util.h:57:14: error: inline function ‘list_first’ declared but never defined [-Werror] inline void *list_first(list_t *list); ^ list_util.h:55:13: error: inline function ‘list_node_data_set’ declared but never defined [-Werror] inline void list_node_data_set(list_node_t *node, void *data); ^ list_util.h:54:14: error: inline function ‘list_node_data_get’ declared but never defined [-Werror] inline void *list_node_data_get(list_node_t *node); ^ list_util.h:52:21: error: inline function ‘list_count’ declared but never defined [-Werror] inline unsigned int list_count(list_t *list); ^ cc1: all warnings being treated as errors Makefile:499: recipe for target 'capability_parsing.lo' failed make[2]: *** [capability_parsing.lo] Error 1 make[2]: *** Waiting for unfinished jobs....
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- libxkutil/list_util.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
The last time I compiled libvirt-cim this wasn't an issue! Additionally my daily Coverity builds libvirt-cim from upstream from scratch without issue...
So is this from a 'newer' compiler? I have:
$ gcc --version gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6) Copyright (C) 2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I'm not disagreeing this is a problem and needs to be fixed...
$ gcc --version gcc (GCC) 5.1.1 20150422 (Red Hat 5.1.1-1) Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. So yes, I believe that's the problem.
John
FWIW:
libvirt-cim patches have been sent to the libvirt-cim list @libvirt-cim@redhat.com and not libvir-list...
Ah, sorry about that. Michal

On Tue, Apr 28, 2015 at 08:53:28AM -0400, John Ferlan wrote:
FWIW:
libvirt-cim patches have been sent to the libvirt-cim list @libvirt-cim@redhat.com and not libvir-list...
Given that the libvirt CIM project is in maint mode only aat this point, with little to no feature work, I'm not sure there is a compelling reason to continue with a separate mailing list for it. I'd suggest we close down libvirt-cim@redhat.com and redirect all discussion & patches to this main libvir-list@redhat.com list, alongside all other libvirt projects. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Tue, Apr 28, 2015 at 08:53:28AM -0400, John Ferlan wrote:
On 04/28/2015 07:58 AM, Michal Privoznik wrote:
There's no need to mark a function as inline in the function declaration. In fact, it causes a compilation error:
CC xmlgen.lo In file included from acl_parsing.h:29:0, from xmlgen.h:26, from capability_parsing.c:37: list_util.h:67:21: error: inline function ‘list_node_prev_node’ declared but never defined [-Werror] inline list_node_t *list_node_prev_node(list_node_t *node); ^
[...]
cc1: all warnings being treated as errors Makefile:499: recipe for target 'capability_parsing.lo' failed make[2]: *** [capability_parsing.lo] Error 1 make[2]: *** Waiting for unfinished jobs....
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- libxkutil/list_util.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
The last time I compiled libvirt-cim this wasn't an issue! Additionally my daily Coverity builds libvirt-cim from upstream from scratch without issue...
So is this from a 'newer' compiler? I have:
$ gcc --version gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6) Copyright (C) 2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I'm not disagreeing this is a problem and needs to be fixed...
John
This happens only on fedora-rawhide where is a new gcc that almost fully supports the new c99 standard and that standard is a default one on that gcc version. $ gcc --version gcc (GCC) 5.0.0 20150407 (Red Hat 5.0.0-0.22)
FWIW:
libvirt-cim patches have been sent to the libvirt-cim list @libvirt-cim@redhat.com and not libvir-list...
diff --git a/libxkutil/list_util.h b/libxkutil/list_util.h index 6510272..6582dfe 100644 --- a/libxkutil/list_util.h +++ b/libxkutil/list_util.h @@ -49,22 +49,22 @@ void list_remove_node(list_t *list, list_node_t *node);
bool list_foreach(list_t *list, list_foreach_cb cb, void *user_data);
-inline unsigned int list_count(list_t *list); +unsigned int list_count(list_t *list);
-inline void *list_node_data_get(list_node_t *node); -inline void list_node_data_set(list_node_t *node, void *data); +void *list_node_data_get(list_node_t *node); +void list_node_data_set(list_node_t *node, void *data);
-inline void *list_first(list_t *list); -inline list_node_t *list_first_node(list_t *list); +void *list_first(list_t *list); +list_node_t *list_first_node(list_t *list);
-inline void *list_last(list_t *list); -inline list_node_t *list_last_node(list_t *list); +void *list_last(list_t *list); +list_node_t *list_last_node(list_t *list);
-inline void *list_node_next(list_node_t *node); -inline list_node_t *list_node_next_node(list_node_t *node); +void *list_node_next(list_node_t *node); +list_node_t *list_node_next_node(list_node_t *node);
-inline void *list_node_prev(list_node_t *node); -inline list_node_t *list_node_prev_node(list_node_t *node); +void *list_node_prev(list_node_t *node); +list_node_t *list_node_prev_node(list_node_t *node);
#ifdef __cplusplus } /* extern "C" */
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On 04/28/2015 07:58 AM, Michal Privoznik wrote:
There's no need to mark a function as inline in the function declaration. In fact, it causes a compilation error:
CC xmlgen.lo In file included from acl_parsing.h:29:0, from xmlgen.h:26, from capability_parsing.c:37: list_util.h:67:21: error: inline function ‘list_node_prev_node’ declared but never defined [-Werror] inline list_node_t *list_node_prev_node(list_node_t *node); ^ list_util.h:66:14: error: inline function ‘list_node_prev’ declared but never defined [-Werror] inline void *list_node_prev(list_node_t *node); ^ list_util.h:64:21: error: inline function ‘list_node_next_node’ declared but never defined [-Werror] inline list_node_t *list_node_next_node(list_node_t *node); ^ list_util.h:63:14: error: inline function ‘list_node_next’ declared but never defined [-Werror] inline void *list_node_next(list_node_t *node); ^ list_util.h:61:21: error: inline function ‘list_last_node’ declared but never defined [-Werror] inline list_node_t *list_last_node(list_t *list); ^ list_util.h:60:14: error: inline function ‘list_last’ declared but never defined [-Werror] inline void *list_last(list_t *list); ^ list_util.h:58:21: error: inline function ‘list_first_node’ declared but never defined [-Werror] inline list_node_t *list_first_node(list_t *list); ^ list_util.h:57:14: error: inline function ‘list_first’ declared but never defined [-Werror] inline void *list_first(list_t *list); ^ list_util.h:55:13: error: inline function ‘list_node_data_set’ declared but never defined [-Werror] inline void list_node_data_set(list_node_t *node, void *data); ^ list_util.h:54:14: error: inline function ‘list_node_data_get’ declared but never defined [-Werror] inline void *list_node_data_get(list_node_t *node); ^ list_util.h:52:21: error: inline function ‘list_count’ declared but never defined [-Werror] inline unsigned int list_count(list_t *list); ^ cc1: all warnings being treated as errors Makefile:499: recipe for target 'capability_parsing.lo' failed make[2]: *** [capability_parsing.lo] Error 1 make[2]: *** Waiting for unfinished jobs....
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- libxkutil/list_util.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
So back to the original patch - it's a build breaker, so I suppose it could be pushed for that reason, but to be official... ACK, John
participants (4)
-
Daniel P. Berrange
-
John Ferlan
-
Michal Privoznik
-
Pavel Hrdina