This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: MinGW compilation warnings in libiberty's xstrndup.c
- From: Pedro Alves <palves at redhat dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: eliz at gnu dot org, gcc-patches at gcc dot gnu dot org, gdb-patches at sourceware dot org
- Date: Fri, 19 May 2017 23:56:04 +0100
- Subject: Re: MinGW compilation warnings in libiberty's xstrndup.c
- Authentication-results: sourceware.org; auth=none
- References: <xn8tlsiimt.fsf@greed.delorie.com>
On 05/19/2017 11:31 PM, DJ Delorie wrote:
>
> Right, I meant, libiberty's configure, gcc's configure, binutils'
> configure, and gdb's configure, all need to agree on whether strnlen is
> a HAVE or a HAVE_DECL type symbol. If they don't, the header can't
> provide "one" working solution.
>
Ah, yeah. AFAICS, all the declaration checks in libiberty.h are
HAVE_DECL checks. This suggests to me that this declaration guard
should be HAVE_DECL too [1].
BTW, I once proposed a new libiberty.m4 file that all libiberty
clients would source so that these checks are all centralized.
Here:
https://gcc.gnu.org/ml/gcc-patches/2015-02/msg00580.html
And follow up here:
https://gcc.gnu.org/ml/gcc-patches/2015-02/msg01712.html
Leading to (as, gold, ld, gdb and libiberty/ itself converted):
https://github.com/palves/gdb/commits/palves/libiberty_m4
I never tried adjusting gcc, but even if it wouldn't
work there, it'd still be a net win.
Wonder what others think of that approach.
Thanks,
Pedro Alves