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 22A933858425 for ; Tue, 20 Dec 2022 15:05:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 22A933858425 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: from tarox.wildebeest.org (83-87-18-245.cable.dynamic.v4.ziggo.nl [83.87.18.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id EEFF230006EE; Tue, 20 Dec 2022 16:05:41 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id C98F1413CD0E; Tue, 20 Dec 2022 16:05:40 +0100 (CET) Message-ID: <0a7ce42a5fea627182513fd0c476a02198d7bbcd.camel@klomp.org> Subject: Re: [PATCH 09/25] include libgen.h in system.h From: Mark Wielaard To: luoyonggang@gmail.com Cc: elfutils-devel@sourceware.org Date: Tue, 20 Dec 2022 16:05:40 +0100 In-Reply-To: References: <20221020182603.815-1-luoyonggang@gmail.com> <20221020182603.815-10-luoyonggang@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-10.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-3031.1 required=5.0 tests=BAYES_00,BODY_8BITS,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: On Sat, 2022-12-17 at 05:22 +0800, =E7=BD=97=E5=8B=87=E5=88=9A(Yonggang Luo= ) wrote: > On Fri, Oct 28, 2022 at 7:45 PM Mark Wielaard wrote: > >=20 > > On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel > > wrote: > > > basename function are accessed multiple place, but used without > > > include libgen.h > >=20 > > This is wrong. We use the GNU basename (from string.h with > > _GNU_SOURCE), not the POSIX one (from libgen.h). >=20 > Thanks, that informs me, are they the same thing? No, they are subtly different things. See https://www.man7.org/linux/man-pages/man3/basename.3.html#NOTES In particular the GNU basename never manipulates its argument (which is why the cast is wrong). Cheers, Mark