[parted-devel] gnulib commit 0aa8ef42465 - free: Fix warning breaks parted

Bruno Haible bruno at clisp.org
Tue Jan 26 17:39:23 GMT 2021


Hi,

Brian C. Lane wrote:
> I encountered this while trying to prepare a new release of parted 3.4,
> after updating gnulib to commits past b07286e464 (free-posix: port to
> GNU/Linux) builds exit with this puzzling error:
> 
> make[4]: Entering directory '/home/bcl/Red_Hat/projs/parted/libparted/labels'
>   CC       aix.lo
> In file included from ../../include/parted/parted.h:44,
>                  from aix.c:25:
> pt-common.h:39:1: error: 'PedDiskOps' {aka 'const struct _PedDiskOps'} has no member named 'rpl_free'
>    39 | free:                         PT_type##_free,   \
>       | ^~~~
> aix.c:217:2: note: in expansion of macro 'PT_op_function_initializers'
>   217 |  PT_op_function_initializers (aix)
>       |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> make[4]: *** [Makefile:1600: aix.lo] Error 1

The fix is to add a
  #include <stdlib.h>
near the beginning of the .h file that defines 'struct _PedDiskOps'.

And also
  #include <unistd.h>
since the struct appears to have a field named 'read', and 'read' can
be redefined to 'rpl_read' in gnulib's <unistd.h>.

> I'm not sure what the right fix for this is, but I'd appreciate it if
> someone could figure out a way to do this that doesn't involve
> arbitrarily re-defining words that may be used in other contexts.

For C++ programs, defining GNULIB_NAMESPACE is the better workaround.
But for C programs, no better workaround is known.

Bruno




More information about the parted-devel mailing list