This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Likely incorrect patch: remove the faulty basename() prototype from libiberty
- From: Joseph Myers <joseph at codesourcery dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: Ed Schouten <ed at nuxi dot nl>, <gdb-patches at sourceware dot org>
- Date: Thu, 2 Jun 2016 21:27:23 +0000
- Subject: Re: Likely incorrect patch: remove the faulty basename() prototype from libiberty
- Authentication-results: sourceware.org; auth=none
- References: <xnbn3o3ibh dot fsf at greed dot delorie dot com>
On Sun, 29 May 2016, DJ Delorie wrote:
> I think the right path to go down is to add libgen.h to the list in
> AC_CHECK_HEADERS for every project that uses basename() (including
> libiberty itself, and binutils, gdb, and gcc), and then everyone who
> uses basename() from libiberty.h would need to include libgen.h *if*
> it's found by configure.
Note that there are two different and incompatible basename functions.
libgen.h has the POSIX one. libiberty has the GNU one (which glibc
declares in <string.h> with _GNU_SOURCE). If you include libgen.h with
glibc, you get basename defined to __xpg_basename, which presumably is not
what is wanted by applications using libiberty.
--
Joseph S. Myers
joseph@codesourcery.com