This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v8] C++ify gdb/common/environ.c
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>
- Cc: GDB Patches <gdb-patches at sourceware dot org>, Pedro Alves <palves at redhat dot com>
- Date: Tue, 20 Jun 2017 09:00:34 -0400
- Subject: Re: [PATCH v8] C++ify gdb/common/environ.c
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx09.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 09D9B4ACCB
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 09D9B4ACCB
- References: <20170413040455.23996-1-sergiodj@redhat.com> <20170620032740.30497-1-sergiodj@redhat.com> <b93e6e6d8991960781da5f582d4017b7@polymtl.ca>
On Tuesday, June 20 2017, Simon Marchi wrote:
> On 2017-06-20 05:27, Sergio Durigan Junior wrote:
>> +/* Create a gdb_environ object using the host's environment
>> + variables. */
>
> This comment (about from_host_environ) should probably go in the
> header file, with a /* See common/environ.h. */ here.
Fixed.
>> + /* Return the value in the environment for the variable VAR. The
>> + return pointer is only valid as long as VAR is not
>
> return -> returned?
Fixed.
>> + removed/replaced from the environment. */
>
> What if another variable is set and it causes reallocation of the
> vector? We could be safe and say "as long as the gdb_environ object
> is not modified".
Fixed.
> Otherwise, LGTM.
Thanks to both of you for the valuable comments.
Pushed.
9a6c7d9c021cfeb290d76584db7a01e57e7c3d4e
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/