Comments on new resolv.c additions

Denys Vlasenko vda.linux at googlemail.com
Wed Sep 14 13:19:42 UTC 2011


On Sun, Sep 11, 2011 at 10:50 PM, Daniel Mack <zonque at gmail.com> wrote:
>> -extern struct _ns_flagdata _ns_flagdata[];
>> +extern const struct _ns_flagdata _ns_flagdata[];
>>
>> This table is used exactly in one place. You can make it static
>> (and smaller).
>
> I had quite some trouble getting this detail straight, I remember. The
> particular problem here is that ns_flagdata[] is accesses as an
> exernal array from applications,

Really? There are applications which use _ns_flagdata[]?
Despite this comment above it? -
/* Private data structure - do not use from outside library. */

Google code search did not find those apps for me.

> as the helper macros just dereference
> values from it. Hence, it can not be static, unfortunately.

I see no macros which reference _ns_flagdata[].
In fact, there is precisely one usage of the array
in the entire tree:

int ns_msg_getflag(ns_msg handle, int flag)
{
        return ((handle)._flags & _ns_flagdata[flag].mask) >>
_ns_flagdata[flag].shift;
}


-- 
vda


More information about the uClibc mailing list