Daniel P. Berrange
2017-06-02 16:25:20 UTC
Fedora rawhide is now shipping with glibc 2.25.90 and when trying to
build libvirt with gnulib's getopt module, it crashes & burns
CC getopt.lo
In file included from ./getopt.h:57:0,
from ../../../gnulib/lib/getopt.c:26:
../../config.h:2934:25: warning: 'struct rpl_option' declared inside parameter list will not be visible outside of this definition or declaration
#define __GETOPT_PREFIX rpl_
^
../../../gnulib/lib/getopt_pfx_core.h:38:44: note: in expansion of macro '__GETOPT_PREFIX'
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
^~~~~~~~~~~~~~~
../../config.h:2934:25: warning: 'struct rpl_option' declared inside parameter list will not be visible outside of this definition or declaration
#define __GETOPT_PREFIX rpl_
^
../../../gnulib/lib/getopt_pfx_core.h:38:44: note: in expansion of macro '__GETOPT_PREFIX'
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
^~~~~~~~~~~~~~~
../../config.h:2934:25: warning: 'struct rpl_option' declared inside parameter list will not be visible outside of this definition or declaration
#define __GETOPT_PREFIX rpl_
^
../../../gnulib/lib/getopt_pfx_core.h:38:44: note: in expansion of macro '__GETOPT_PREFIX'
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
^~~~~~~~~~~~~~~
../../config.h:2934:25: warning: 'struct rpl_option' declared inside parameter list will not be visible outside of this definition or declaration
#define __GETOPT_PREFIX rpl_
^
../../../gnulib/lib/getopt_pfx_core.h:38:44: note: in expansion of macro '__GETOPT_PREFIX'
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
^~~~~~~~~~~~~~~
../../config.h:2934:25: warning: 'struct rpl_option' declared inside parameter list will not be visible outside of this definition or declaration
#define __GETOPT_PREFIX rpl_
^
../../../gnulib/lib/getopt_pfx_core.h:38:44: note: in expansion of macro '__GETOPT_PREFIX'
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
^~~~~~~~~~~~~~~
../../../gnulib/lib/getopt.c: In function 'process_long_option':
../../../gnulib/lib/getopt.c:213:38: error: dereferencing pointer to incomplete type 'const struct rpl_option'
for (p = longopts, n_options = 0; p->name; p++, n_options++)
^~
../../../gnulib/lib/getopt.c:213:47: error: increment of pointer to an incomplete type 'const struct rpl_option'
for (p = longopts, n_options = 0; p->name; p++, n_options++)
^~
../../../gnulib/lib/getopt.c:231:54: error: increment of pointer to an incomplete type 'const struct rpl_option'
for (p = longopts, option_index = 0; p->name; p++, option_index++)
^~
../../../gnulib/lib/getopt.c:291:27: error: invalid use of undefined type 'struct rpl_option'
prefix, longopts[option_index].name);
^
../../../gnulib/lib/getopt.c:291:27: error: dereferencing pointer to incomplete type 'const struct rpl_option'
In file included from ./getopt.h:57:0,
from ../../../gnulib/lib/getopt.c:26:
../../../gnulib/lib/getopt.c: At top level:
../../config.h:2934:25: warning: 'struct rpl_option' declared inside parameter list will not be visible outside of this definition or declaration
#define __GETOPT_PREFIX rpl_
^
../../../gnulib/lib/getopt_pfx_core.h:38:44: note: in expansion of macro '__GETOPT_PREFIX'
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
^~~~~~~~~~~~~~~
../../../gnulib/lib/getopt.c:472:1: error: conflicting types for '_getopt_internal_r'
_getopt_internal_r (int argc, char **argv, const char *optstring,
^~~~~~~~~~~~~~~~~~
In file included from ../../../gnulib/lib/getopt.c:82:0:
../../../gnulib/lib/getopt_int.h:100:12: note: previous declaration of '_getopt_internal_r' was here
extern int _getopt_internal_r (int ___argc, char **___argv,
^~~~~~~~~~~~~~~~~~
../../../gnulib/lib/getopt.c: In function '_getopt_internal_r':
../../../gnulib/lib/getopt.c:575:59: warning: passing argument 4 of 'process_long_option' from incompatible pointer type [-Wincompatible-pointer-types]
return process_long_option (argc, argv, optstring, longopts,
^~~~~~~~
../../../gnulib/lib/getopt.c:195:1: note: expected 'const struct rpl_option *' but argument is of type 'const struct rpl_option *'
process_long_option (int argc, char **argv, const char *optstring,
^~~~~~~~~~~~~~~~~~~
../../../gnulib/lib/getopt.c:597:59: warning: passing argument 4 of 'process_long_option' from incompatible pointer type [-Wincompatible-pointer-types]
code = process_long_option (argc, argv, optstring, longopts,
^~~~~~~~
../../../gnulib/lib/getopt.c:195:1: note: expected 'const struct rpl_option *' but argument is of type 'const struct rpl_option *'
process_long_option (int argc, char **argv, const char *optstring,
^~~~~~~~~~~~~~~~~~~
../../../gnulib/lib/getopt.c:652:53: warning: passing argument 4 of 'process_long_option' from incompatible pointer type [-Wincompatible-pointer-types]
return process_long_option (argc, argv, optstring, longopts, longind,
^~~~~~~~
../../../gnulib/lib/getopt.c:195:1: note: expected 'const struct rpl_option *' but argument is of type 'const struct rpl_option *'
process_long_option (int argc, char **argv, const char *optstring,
^~~~~~~~~~~~~~~~~~~
In file included from ./getopt.h:57:0,
from ../../../gnulib/lib/getopt.c:26:
../../../gnulib/lib/getopt.c: At top level:
../../config.h:2934:25: warning: 'struct rpl_option' declared inside parameter list will not be visible outside of this definition or declaration
#define __GETOPT_PREFIX rpl_
^
../../../gnulib/lib/getopt_pfx_core.h:38:44: note: in expansion of macro '__GETOPT_PREFIX'
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
^~~~~~~~~~~~~~~
../../../gnulib/lib/getopt.c:704:1: error: conflicting types for '_getopt_internal'
_getopt_internal (int argc, char **argv, const char *optstring,
^~~~~~~~~~~~~~~~
In file included from ../../../gnulib/lib/getopt.c:82:0:
../../../gnulib/lib/getopt_int.h:24:12: note: previous declaration of '_getopt_internal' was here
extern int _getopt_internal (int ___argc, char **___argv,
^~~~~~~~~~~~~~~~
../../../gnulib/lib/getopt.c: In function '_getopt_internal':
../../../gnulib/lib/getopt.c:713:55: warning: passing argument 4 of '_getopt_internal_r' from incompatible pointer type [-Wincompatible-pointer-types]
result = _getopt_internal_r (argc, argv, optstring, longopts,
^~~~~~~~
../../../gnulib/lib/getopt.c:472:1: note: expected 'const struct rpl_option *' but argument is of type 'const struct rpl_option *'
_getopt_internal_r (int argc, char **argv, const char *optstring,
^~~~~~~~~~~~~~~~~~
If I remove the include_next call that pulls in the system getopt.h
header file, it all works fine. ie edit gnulib/lib/getopt.in.h to
remove:
# include_next <getopt.h>
The same gnulib code works fine on previous glibc - eg 2.24 version.
Alternatively, if I roll back gnulib to before:
commit e7207fdf6ac20e8228d99248a73816f99ba8ce78 (HEAD)
Author: Zack Weinberg <***@panix.com>
Date: Thu Apr 6 11:14:14 2017 -0700
getopt: split up getopt.in.h and eliminate __need_getopt
then it also works fine.
It appears that the getopt header in glibc 2.25.90 has changed
quite a bit and somehow that's conflicting with gnulib's recent
getopt changes.
Regards,
Daniel
build libvirt with gnulib's getopt module, it crashes & burns
CC getopt.lo
In file included from ./getopt.h:57:0,
from ../../../gnulib/lib/getopt.c:26:
../../config.h:2934:25: warning: 'struct rpl_option' declared inside parameter list will not be visible outside of this definition or declaration
#define __GETOPT_PREFIX rpl_
^
../../../gnulib/lib/getopt_pfx_core.h:38:44: note: in expansion of macro '__GETOPT_PREFIX'
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
^~~~~~~~~~~~~~~
../../config.h:2934:25: warning: 'struct rpl_option' declared inside parameter list will not be visible outside of this definition or declaration
#define __GETOPT_PREFIX rpl_
^
../../../gnulib/lib/getopt_pfx_core.h:38:44: note: in expansion of macro '__GETOPT_PREFIX'
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
^~~~~~~~~~~~~~~
../../config.h:2934:25: warning: 'struct rpl_option' declared inside parameter list will not be visible outside of this definition or declaration
#define __GETOPT_PREFIX rpl_
^
../../../gnulib/lib/getopt_pfx_core.h:38:44: note: in expansion of macro '__GETOPT_PREFIX'
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
^~~~~~~~~~~~~~~
../../config.h:2934:25: warning: 'struct rpl_option' declared inside parameter list will not be visible outside of this definition or declaration
#define __GETOPT_PREFIX rpl_
^
../../../gnulib/lib/getopt_pfx_core.h:38:44: note: in expansion of macro '__GETOPT_PREFIX'
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
^~~~~~~~~~~~~~~
../../config.h:2934:25: warning: 'struct rpl_option' declared inside parameter list will not be visible outside of this definition or declaration
#define __GETOPT_PREFIX rpl_
^
../../../gnulib/lib/getopt_pfx_core.h:38:44: note: in expansion of macro '__GETOPT_PREFIX'
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
^~~~~~~~~~~~~~~
../../../gnulib/lib/getopt.c: In function 'process_long_option':
../../../gnulib/lib/getopt.c:213:38: error: dereferencing pointer to incomplete type 'const struct rpl_option'
for (p = longopts, n_options = 0; p->name; p++, n_options++)
^~
../../../gnulib/lib/getopt.c:213:47: error: increment of pointer to an incomplete type 'const struct rpl_option'
for (p = longopts, n_options = 0; p->name; p++, n_options++)
^~
../../../gnulib/lib/getopt.c:231:54: error: increment of pointer to an incomplete type 'const struct rpl_option'
for (p = longopts, option_index = 0; p->name; p++, option_index++)
^~
../../../gnulib/lib/getopt.c:291:27: error: invalid use of undefined type 'struct rpl_option'
prefix, longopts[option_index].name);
^
../../../gnulib/lib/getopt.c:291:27: error: dereferencing pointer to incomplete type 'const struct rpl_option'
In file included from ./getopt.h:57:0,
from ../../../gnulib/lib/getopt.c:26:
../../../gnulib/lib/getopt.c: At top level:
../../config.h:2934:25: warning: 'struct rpl_option' declared inside parameter list will not be visible outside of this definition or declaration
#define __GETOPT_PREFIX rpl_
^
../../../gnulib/lib/getopt_pfx_core.h:38:44: note: in expansion of macro '__GETOPT_PREFIX'
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
^~~~~~~~~~~~~~~
../../../gnulib/lib/getopt.c:472:1: error: conflicting types for '_getopt_internal_r'
_getopt_internal_r (int argc, char **argv, const char *optstring,
^~~~~~~~~~~~~~~~~~
In file included from ../../../gnulib/lib/getopt.c:82:0:
../../../gnulib/lib/getopt_int.h:100:12: note: previous declaration of '_getopt_internal_r' was here
extern int _getopt_internal_r (int ___argc, char **___argv,
^~~~~~~~~~~~~~~~~~
../../../gnulib/lib/getopt.c: In function '_getopt_internal_r':
../../../gnulib/lib/getopt.c:575:59: warning: passing argument 4 of 'process_long_option' from incompatible pointer type [-Wincompatible-pointer-types]
return process_long_option (argc, argv, optstring, longopts,
^~~~~~~~
../../../gnulib/lib/getopt.c:195:1: note: expected 'const struct rpl_option *' but argument is of type 'const struct rpl_option *'
process_long_option (int argc, char **argv, const char *optstring,
^~~~~~~~~~~~~~~~~~~
../../../gnulib/lib/getopt.c:597:59: warning: passing argument 4 of 'process_long_option' from incompatible pointer type [-Wincompatible-pointer-types]
code = process_long_option (argc, argv, optstring, longopts,
^~~~~~~~
../../../gnulib/lib/getopt.c:195:1: note: expected 'const struct rpl_option *' but argument is of type 'const struct rpl_option *'
process_long_option (int argc, char **argv, const char *optstring,
^~~~~~~~~~~~~~~~~~~
../../../gnulib/lib/getopt.c:652:53: warning: passing argument 4 of 'process_long_option' from incompatible pointer type [-Wincompatible-pointer-types]
return process_long_option (argc, argv, optstring, longopts, longind,
^~~~~~~~
../../../gnulib/lib/getopt.c:195:1: note: expected 'const struct rpl_option *' but argument is of type 'const struct rpl_option *'
process_long_option (int argc, char **argv, const char *optstring,
^~~~~~~~~~~~~~~~~~~
In file included from ./getopt.h:57:0,
from ../../../gnulib/lib/getopt.c:26:
../../../gnulib/lib/getopt.c: At top level:
../../config.h:2934:25: warning: 'struct rpl_option' declared inside parameter list will not be visible outside of this definition or declaration
#define __GETOPT_PREFIX rpl_
^
../../../gnulib/lib/getopt_pfx_core.h:38:44: note: in expansion of macro '__GETOPT_PREFIX'
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
^~~~~~~~~~~~~~~
../../../gnulib/lib/getopt.c:704:1: error: conflicting types for '_getopt_internal'
_getopt_internal (int argc, char **argv, const char *optstring,
^~~~~~~~~~~~~~~~
In file included from ../../../gnulib/lib/getopt.c:82:0:
../../../gnulib/lib/getopt_int.h:24:12: note: previous declaration of '_getopt_internal' was here
extern int _getopt_internal (int ___argc, char **___argv,
^~~~~~~~~~~~~~~~
../../../gnulib/lib/getopt.c: In function '_getopt_internal':
../../../gnulib/lib/getopt.c:713:55: warning: passing argument 4 of '_getopt_internal_r' from incompatible pointer type [-Wincompatible-pointer-types]
result = _getopt_internal_r (argc, argv, optstring, longopts,
^~~~~~~~
../../../gnulib/lib/getopt.c:472:1: note: expected 'const struct rpl_option *' but argument is of type 'const struct rpl_option *'
_getopt_internal_r (int argc, char **argv, const char *optstring,
^~~~~~~~~~~~~~~~~~
If I remove the include_next call that pulls in the system getopt.h
header file, it all works fine. ie edit gnulib/lib/getopt.in.h to
remove:
# include_next <getopt.h>
The same gnulib code works fine on previous glibc - eg 2.24 version.
Alternatively, if I roll back gnulib to before:
commit e7207fdf6ac20e8228d99248a73816f99ba8ce78 (HEAD)
Author: Zack Weinberg <***@panix.com>
Date: Thu Apr 6 11:14:14 2017 -0700
getopt: split up getopt.in.h and eliminate __need_getopt
then it also works fine.
It appears that the getopt header in glibc 2.25.90 has changed
quite a bit and somehow that's conflicting with gnulib's recent
getopt changes.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|