Martin Buchholz martinrb at google.com
Wed Apr 10 18:54:15 UTC 2013

On Wed, Apr 10, 2013 at 11:24 AM, Christos Zoulas <christos at zoulas.com>wrote:

> On Apr 10,  1:54pm, john.zavgren at oracle.com (John Zavgren) wrote:
> -- Subject: Re: RFR-8008118
> | Your comments are welcome.
> 1. We did we switch from NEW() to xmalloc()? Why is the xmalloc cast
> needed?

NEW is for allocating homogeneous arrays, but here the memory block is
being used for both chars and pointers.

> 2. I would not declare pathv "const char **", but "char **", and then
>    cast the return if needed. This will make life easier in the future
>    if we decide to turn on warnings about const-castaways.
I believe the current code doesn't cast away const and doesn't write to
const.  The only cast is to the return from xmalloc, which is expected.
 What might a compiler warn about?

> Otherwise LGTM.
> christos

More information about the core-libs-dev mailing list