This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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] nscd: Deallocate existing user names in file parser


Florian Weimer <fw@deneb.enyo.de> writes:
>> 1. A suitable comment would have make it clearer :-)
>
> I thought this was a standard pattern. 8-)

Well, like I said, I don't feel strongly about it.  It looked weird;
I've never had to cast a pointer I'd passed to free() before, and in C++
you cast when you need to match types, so it looked like you were
casting to char* to match what free() expected.

>> 2. Why are those variables const in the first place?  They're only ever
>>    assigned values from xstrdup(), which isn't const.
>
> Presumably to make clear that no in-place modification is expected.  I
> could drop the const from the pointers, then the cast won't be needed
> anymore.

I don't think it's worth the effort, it just seemed weird.


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