Likely incorrect patch: remove the faulty basename() prototype from libiberty

Joseph Myers joseph@codesourcery.com
Thu Jun 2 21:27:00 GMT 2016


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



More information about the Gdb-patches mailing list