[PATCH] lib/color: Fix compilation with uClibc

2019-05-03 Thread Rosen Penev
elfutils passed -Werror and this call errors on uClibc with a mismatching
pointer type. Cast to char * to fix.

Signed-off-by: Rosen Penev 
---
 lib/color.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/color.c b/lib/color.c
index 9ffbf55f..20b9698a 100644
--- a/lib/color.c
+++ b/lib/color.c
@@ -132,7 +132,7 @@ valid arguments are:\n\
   - 'auto', 'tty', 'if-tty'\n"),
 program_invocation_short_name, arg);
  argp_help (&color_argp, stderr, ARGP_HELP_SEE,
-program_invocation_short_name);
+(char *) program_invocation_short_name);
  exit (EXIT_FAILURE);
}
}
-- 
2.17.1



[PATCH] libelf: remove usage of sys/cdefs

2020-04-05 Thread Rosen Penev via Elfutils-devel
sys/cdefs is a deprecated glibc header that is unavailable with other
libc implementations such as musl.

features.h under glibc includes sys/cdefs whereas it does not under musl.

Signed-off-by: Rosen Penev 
---
 lib/fixedsizehash.h |  1 -
 libelf/elf.h| 10 ++
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h
index dac2a5f5..43016fc3 100644
--- a/lib/fixedsizehash.h
+++ b/lib/fixedsizehash.h
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
diff --git a/libelf/elf.h b/libelf/elf.h
index 01648bdb..d36fb806 100644
--- a/libelf/elf.h
+++ b/libelf/elf.h
@@ -19,9 +19,9 @@
 #ifndef _ELF_H
 #define_ELF_H 1
 
-#include 
-
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* Standard ELF types.  */
 
@@ -4007,6 +4007,8 @@ enum
 #define R_NDS32_TLS_TPOFF  102
 #define R_NDS32_TLS_DESC   119
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* elf.h */
-- 
2.25.1



Re: [PATCH] libelf: remove usage of sys/cdefs

2020-04-05 Thread Rosen Penev via Elfutils-devel
On Sun, Apr 5, 2020 at 4:39 PM Mark Wielaard  wrote:
>
> Hi,
>
> Thanks for the patch, but elf.h comes from glibc.  So please get your
> fix accepted upstream (sent it to libc-al...@sourceware.org) and we'll
> pick it up next time we sync with the glibc code.
Hrm OK.
>
> Thanks,
>
> Mark