This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix build breakage on MinGW due to missing setenv
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: Anton Kolesov <Anton dot Kolesov at synopsys dot com>, "gdb-patches\@sourceware.org" <gdb-patches at sourceware dot org>, Francois Bedard <Francois dot Bedard at synopsys dot com>
- Date: Mon, 03 Jul 2017 11:26:48 -0400
- Subject: Re: [PATCH] Fix build breakage on MinGW due to missing setenv
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=sergiodj at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A7114C0587DE
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A7114C0587DE
- References: <20170703100258.15837-1-Anton.Kolesov@synopsys.com> <CAH=s-PO5oSxNCTFqqvK+f=4-q40c_soPii+MtonoKmP6capZpg@mail.gmail.com>
On Monday, July 03 2017, Yao Qi wrote:
> On Mon, Jul 3, 2017 at 11:02 AM, Anton Kolesov
> <Anton.Kolesov@synopsys.com> wrote:
>> Patch [1] broke a build on MinGW hosts, because MinGW doesn't provide POSIX
>> functions setenv () and unsetenv (), instead there is a putenv () wrapper
>> around WinAPI function, although with a different signature.
>>
>> [1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=9a6c7d9c0
>
> The better fix, IMO, is to use setenv and unsetenv
> module in gnulib. However, I didn't check gnulib
> manual about portability problems not fixed by gnulib.
According to:
<https://www.gnu.org/software/gnulib/manual/html_node/setenv.html#setenv>
There is only one portability problem not fixed by gnulib, and I don't
think it affects us:
Older versions of POSIX required that setenv(NULL,"",0) gracefully
fail with EINVAL, but not all implementations guarantee this, and the
requirement was removed.
So it should be possible to import setenv from gnulib without problems,
I think.
Cheers,
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/