This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v8] C++ify gdb/common/environ.c


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.

+  /* Return the value in the environment for the variable VAR.  The
+     return pointer is only valid as long as VAR is not

return -> returned?

+     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".

Otherwise, LGTM.

Simon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]