clang complains:
In file included from debuginfod-client.c:38:
./../debuginfod/debuginfod.h:47:34: error: redefinition of typedef
'debuginfod_client' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef struct debuginfod_client debuginfod_client;
^
./libdwfl.h:53:34: note: previous definition is here
typedef struct debuginfod_client debuginfod_client;
^
config/eu.am specifies -std=gnu99, and upgrading just for this is an
overkill. So is #including "debuginfod.h", since we don't know if users
even have it. So fix by using "struct debuginfod_client" instead. This
may break the clients that use dwfl_get_debuginfod_client() without
#including "debuginfod.h", but such cases should be rare.
Signed-off-by: Ilya Leoshkevich <[email protected]>
---
libdwfl/debuginfod-client.c | 2 +-
libdwfl/libdwfl.h | 5 +----
libdwfl/libdwflP.h | 4 ++--
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/libdwfl/debuginfod-client.c b/libdwfl/debuginfod-client.c
index 882a5eff..c6f8e083 100644
--- a/libdwfl/debuginfod-client.c
+++ b/libdwfl/debuginfod-client.c
@@ -143,7 +143,7 @@ __libdwfl_debuginfod_init (void)
#else // ENABLE_LIBDEBUGINFOD
-debuginfod_client *
+struct debuginfod_client *
dwfl_get_debuginfod_client (Dwfl *dummy __attribute__ ((unused)))
{
return NULL;
diff --git a/libdwfl/libdwfl.h b/libdwfl/libdwfl.h
index 9114f7f0..ba2f081f 100644
--- a/libdwfl/libdwfl.h
+++ b/libdwfl/libdwfl.h
@@ -49,9 +49,6 @@ typedef struct Dwfl_Thread Dwfl_Thread;
PC location described by an FDE belonging to Dwfl_Thread. */
typedef struct Dwfl_Frame Dwfl_Frame;
-/* Handle for debuginfod-client connection. */
-typedef struct debuginfod_client debuginfod_client;
-
/* Callbacks. */
typedef struct
{
@@ -813,7 +810,7 @@ int dwfl_frame_reg (Dwfl_Frame *state, unsigned regno,
Dwarf_Word *val)
first call to this function. If elfutils is compiled without support for
debuginfod,
NULL will be returned.
*/
-extern debuginfod_client *dwfl_get_debuginfod_client (Dwfl *dwfl);
+extern struct debuginfod_client *dwfl_get_debuginfod_client (Dwfl *dwfl);
#ifdef __cplusplus
}
diff --git a/libdwfl/libdwflP.h b/libdwfl/libdwflP.h
index cdc528d0..fbd66f45 100644
--- a/libdwfl/libdwflP.h
+++ b/libdwfl/libdwflP.h
@@ -114,7 +114,7 @@ struct Dwfl
{
const Dwfl_Callbacks *callbacks;
#ifdef ENABLE_LIBDEBUGINFOD
- debuginfod_client *debuginfod;
+ struct debuginfod_client *debuginfod;
#endif
Dwfl_Module *modulelist; /* List in order used by full traversals. */
@@ -652,7 +652,7 @@ __libdwfl_debuginfod_find_debuginfo (Dwfl *dwfl,
const unsigned char *build_id_bits,
size_t build_id_len);
void
-__libdwfl_debuginfod_end (debuginfod_client *c);
+__libdwfl_debuginfod_end (struct debuginfod_client *c);
#endif
--
2.39.1