[PATCH] error_prints: fix program_invocation_name type conflict

Edgar Kaziakhmedov edgar.kaziakhmedov at virtuozzo.com
Fri Sep 8 14:38:51 UTC 2017


On Fri, 8 Sep 2017 12:12:57 +0300
Baruch Siach <baruch at tkos.co.il> wrote:

> uClibc-ng declares program_invocation_name as const. This causes the
> build failure below:
> 
> error_prints.c:40:14: error: conflicting types for
> ‘program_invocation_name’ extern char *program_invocation_name;
>               ^~~~~~~~~~~~~~~~~~~~~~~
> In file included from error_prints.c:32:0:
> .../output/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/errno.h:54:20:
> note: previous declaration of ‘program_invocation_name’ was here
> extern const char *program_invocation_name,
> *program_invocation_short_name; ^~~~~~~~~~~~~~~~~~~~~~~
> Makefile:3856: recipe for target 'strace-error_prints.o' failed
> 
> Declare program_invocation_name only when the C library does not
> provide one.
> ---
>  error_prints.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/error_prints.c b/error_prints.c
> index 8519b9246698..710e99b04ab9 100644
> --- a/error_prints.c
> +++ b/error_prints.c
> @@ -37,7 +37,9 @@
>  
>  #include "error_prints.h"
>  
> +#ifndef HAVE_PROGRAM_INVOCATION_NAME
>  extern char *program_invocation_name;
> +#endif
>  
>  static void
>  verror_msg(int err_no, const char *fmt, va_list p)

Good catch. Suppose just commit message should follow
to changelog commit style.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170908/2ad192ae/attachment.bin>


More information about the Strace-devel mailing list