Message ID | 20230206222513.1773039-5-iii@linux.ibm.com |
---|---|
State | Superseded |
Headers |
Return-Path: <elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 944393858000 for <patchwork@sourceware.org>; Mon, 6 Feb 2023 22:26:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 944393858000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675722373; bh=kP81yPbc/MLwQoflFxLnwJGf/nCHweZaJnsKiFo9ngU=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=YBcEKxgE67JrSHFYgKYBpMKVYZGA3fRLujV8al6SbLw9G8ylY20nnDyOen+K4+6PU DgtN/4tc6Q//cfqSBS2t0nCuO5Rc07Hrv8QS5nWd7pxhqmY01jQYEQPZmi9Z7ngwQX XzR/cznfWeuXLIa93Sa4A3JmKr1IDxaitRCOo5x0= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 74D8E385842D for <elfutils-devel@sourceware.org>; Mon, 6 Feb 2023 22:25:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 74D8E385842D Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 316Ljmqb018859 for <elfutils-devel@sourceware.org>; Mon, 6 Feb 2023 22:25:32 GMT Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk9rhrwam-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <elfutils-devel@sourceware.org>; Mon, 06 Feb 2023 22:25:32 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 316Dr1cE015745 for <elfutils-devel@sourceware.org>; Mon, 6 Feb 2023 22:25:30 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma03fra.de.ibm.com (PPS) with ESMTPS id 3nhf06j1jd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <elfutils-devel@sourceware.org>; Mon, 06 Feb 2023 22:25:29 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 316MPQwb25887008 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Feb 2023 22:25:26 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 678F920076; Mon, 6 Feb 2023 22:25:26 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1D24D20074; Mon, 6 Feb 2023 22:25:26 +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:26 +0000 (GMT) To: elfutils-devel@sourceware.org Cc: Ilya Leoshkevich <iii@linux.ibm.com> Subject: [PATCH RFC 04/11] readelf: Fix set but not used parameter Date: Mon, 6 Feb 2023 23:25:06 +0100 Message-Id: <20230206222513.1773039-5-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-GUID: LyGhodErdaZhKeHYs2I_PI4hlJi0F5UH X-Proofpoint-ORIG-GUID: LyGhodErdaZhKeHYs2I_PI4hlJi0F5UH 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 impostorscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 bulkscore=0 adultscore=0 spamscore=0 mlxscore=0 phishscore=0 malwarescore=0 clxscore=1015 mlxlogscore=836 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302060191 X-Spam-Status: No, score=-11.7 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 X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list <elfutils-devel.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/elfutils-devel>, <mailto:elfutils-devel-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/elfutils-devel/> List-Help: <mailto:elfutils-devel-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/elfutils-devel>, <mailto:elfutils-devel-request@sourceware.org?subject=subscribe> From: Ilya Leoshkevich via Elfutils-devel <elfutils-devel@sourceware.org> Reply-To: Ilya Leoshkevich <iii@linux.ibm.com> Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" <elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Add Memory Sanitizer support
|
|
Commit Message
Ilya Leoshkevich
Feb. 6, 2023, 10:25 p.m. UTC
clang complains:
readelf.c:12205:72: error: parameter 'desc' set but not used [-Werror,-Wunused-but-set-parameter]
handle_bit_registers (const Ebl_Register_Location *regloc, const void *desc,
^
Apparently handle_bit_registers() is unimplemented, but one line is
still written for the future. Silence the warning by casting desc to
void.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
src/readelf.c | 1 +
1 file changed, 1 insertion(+)
Comments
Hi Ilya, On Mon, 2023-02-06 at 23:25 +0100, Ilya Leoshkevich via Elfutils-devel wrote: > clang complains: > > readelf.c:12205:72: error: parameter 'desc' set but not used [-Werror,-Wunused-but-set-parameter] > handle_bit_registers (const Ebl_Register_Location *regloc, const void *desc, > ^ > > Apparently handle_bit_registers() is unimplemented, but one line is > still written for the future. Silence the warning by casting desc to > void. Someone else also noticed this and filed a bug report, could you add the bug URL to the commit message? https://sourceware.org/bugzilla/show_bug.cgi?id=30084 Also can we just remove this whole function? It is never really used since as far as I can see we don't have any backend with a core register sets where a register doesn't have a number of bits which isn't a multiple of 8 (only ia64 has some 1 bit registers, but those don't seem part of the core register set). If we do accidentally try to handle such a register having an abort is also not very nice. Lets just warn and return/continue. Something like the attached? Thanks, Mark
diff --git a/src/readelf.c b/src/readelf.c index 51b0e8b9..f09c5c9b 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -12206,6 +12206,7 @@ handle_bit_registers (const Ebl_Register_Location *regloc, const void *desc, unsigned int colno) { desc += regloc->offset; + (void)desc; abort (); /* XXX */ return colno;