From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 398023858D35 for ; Mon, 6 Feb 2023 22:25:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 398023858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 316LVfkH037679 for ; Mon, 6 Feb 2023 22:25:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=KadMHGm+DvV/l4I7MJjOiz4VTIqab21aZLMeAQPSN+c=; b=RVIqkWvEyX07Mq6XuD20hMz0LPJYe/AcyAIfUb/naSnPDL2HGwJGAzhV+Nob1fMlSbtm Y61DR8TIQziyksUF6VhWbfcayetdSVsIEyMSZlQc6Pm+4eKaTeJiTczJXwyMgTk5RYFc hBQfcI+qeo/xKrxX81YMzp11MAz2Vwat6V2i25XiVeY2BeSu0Z6qO+JV52AsGTGyflh5 LtfKj4YTZam3Y8aiHp/uPhNN0fPlXfnvNlfcpKpTxKRNIDWF65PSr84vSTn67mZ3ABXG An49/q3lmNdzFBSQFlBw2ddASBIdnr2kQWXCaniDcA9HOIEmMo9zKUqYjN9Omffu+Dcm iA== Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk9hvs4wn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:27 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 316HBxH0024259 for ; Mon, 6 Feb 2023 22:25:25 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3nhf06tvf1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:25 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 316MPKw449348902 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Feb 2023 22:25:20 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B942120075; Mon, 6 Feb 2023 22:25:20 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 74A8420074; Mon, 6 Feb 2023 22:25:20 +0000 (GMT) Received: from heavy.lan (unknown [9.179.9.231]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Feb 2023 22:25:20 +0000 (GMT) From: Ilya Leoshkevich To: elfutils-devel@sourceware.org Cc: Ilya Leoshkevich Subject: [PATCH RFC 01/11] libdwfl: Fix debuginfod_client redefinition Date: Mon, 6 Feb 2023 23:25:03 +0100 Message-Id: <20230206222513.1773039-2-iii@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230206222513.1773039-1-iii@linux.ibm.com> References: <20230206222513.1773039-1-iii@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 6KrbULTuDyE3QcTTEfUklZUGfqcao4RE X-Proofpoint-GUID: 6KrbULTuDyE3QcTTEfUklZUGfqcao4RE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-06_07,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 spamscore=0 clxscore=1015 phishscore=0 priorityscore=1501 impostorscore=0 adultscore=0 malwarescore=0 mlxscore=0 mlxlogscore=625 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302060191 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 --- 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