bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnulib commit 0aa8ef42465 - free: Fix warning breaks parted


From: Bruno Haible
Subject: Re: gnulib commit 0aa8ef42465 - free: Fix warning breaks parted
Date: Tue, 26 Jan 2021 18:39:23 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-197-generic; KDE/5.18.0; x86_64; ; )

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]