From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 3818A3858D35 for ; Tue, 7 Feb 2023 19:22:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3818A3858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: by gnu.wildebeest.org (Postfix, from userid 1000) id 705DA3000A21; Tue, 7 Feb 2023 20:22:14 +0100 (CET) Date: Tue, 7 Feb 2023 20:22:14 +0100 From: Mark Wielaard To: Ilya Leoshkevich Cc: elfutils-devel@sourceware.org Subject: Re: [PATCH RFC 01/11] libdwfl: Fix debuginfod_client redefinition Message-ID: <20230207192214.GB25444@gnu.wildebeest.org> References: <20230206222513.1773039-1-iii@linux.ibm.com> <20230206222513.1773039-2-iii@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230206222513.1773039-2-iii@linux.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-3031.5 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Ilyam On Mon, Feb 06, 2023 at 11:25:03PM +0100, Ilya Leoshkevich via Elfutils-devel wrote: > 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. This was recently reported by someone else and fixed differently: commit 45576ab5f24cd39669a418fa8e005b4d04f8e9ca Author: Mark Wielaard Date: Mon Feb 6 10:21:58 2023 +0100 debuginfod: Make sure there is only one typedef for debuginfod_client Both debuginfod.h and libdwfl.h have a simple typedef for struct debuginfod_client. Some compilers pedantically warn when including both headers that such typedefs are only officially supported in C11. So guard them with _ELFUTILS_DEBUGINFOD_CLIENT_TYPEDEF to make them happy. https://sourceware.org/bugzilla/show_bug.cgi?id=30077 Signed-off-by: Mark Wielaard Does that work for you? Thanks, Mark