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: DJ Delorie <dj at redhat dot com>
- To: Ed Schouten <ed at nuxi dot nl>
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 29 May 2016 13:35:20 -0400
- Subject: Re: Likely incorrect patch: remove the faulty basename() prototype from libiberty
- Authentication-results: sourceware.org; auth=none
Libiberty provides basename() for those platforms that do not have one.
On platforms that *do* have one, you need to tell libiberty that you
already have one. In your case, including some other header that
prototypes it, and *telling* libiberty that you have done so, is the
right solution.
Including a header that prototypes it, and *not* telling libiberty that
you have done so, leads to the error.
So each project must decide if it has a basename, and if not, it relies
on libiberty to provide one. If you decide you have a basename and
*also* ask libiberty to provide one, you end up with a conflict.
Most of this difficulty comes from the fact that autoconf is run by gdb,
not libiberty, to control the macros that libiberty's includes see when
included by gdb. There is no way for libiberty's autoconf to tell gdb
what to do. So, we can't have a solution that's 100% controlled by
libiberty alone.