This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: MinGW compilation warnings in libiberty's include/environ.h
- 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: Mon, 22 May 2017 18:44:49 +0100
- Subject: Re: MinGW compilation warnings in libiberty's include/environ.h
- Authentication-results: sourceware.org; auth=none
- References: <xnzie8gvwv.fsf@greed.delorie.com>
On 05/20/2017 02:27 AM, DJ Delorie wrote:
>
> Pedro Alves <palves@redhat.com> writes:
>> That sounds to me like the root issue that should be fixed,
>> so that these fallback definitions don't come into into play at all.
>> I.e., why isn't HAVE_ENVIRON_DECL defined on mingw when
>> setenv.o is built? Sounds like a decl check is missing
>> in configure.ac.
>
> environ is tricky because it's typically messy on platforms, unlike a
> standard C function. You can't use a generic check if the macro expands
> to something that interferes with the check.
gnulib has a check, which I assume to be solid:
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=m4/environ.m4
we could import just that bit, I suppose, though every client
of libiberty's environ.h would need to gain the same check.
That's be quite doable with the shared libiberty.m4 idea (we'd just
put the check there), but a nuisance if you have to copy the check all
over the place. At this point it may be more worth it to
invest in finishing the previous use-gnulib-in-gcc effort instead.
Thanks,
Pedro Alves