This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: tunables signed/unsigned bug & patch
- From: Siddhesh Poyarekar <siddhesh at gotplt dot org>
- To: libc-alpha at sourceware dot org
- Date: Fri, 20 Jan 2017 00:06:52 +0530
- Subject: Re: tunables signed/unsigned bug & patch
- Authentication-results: sourceware.org; auth=none
- References: <xnpojiq58x.fsf@greed.delorie.com>
On Thursday 19 January 2017 11:52 PM, DJ Delorie wrote:
> The range check for size_t tunables was checking against
> (signed)(0xfff...fff), which is -1, so never passed (val>0 && val<-1).
> This means half the existing tunables would never work :-(
>
> I couldn't think of a clean way to handle both signed and unsigned in
> the same function, so I split it into separate functions.
>
> As an aside, tunables_strtoul() parses signed values but returns
> unsigned values. Ideally that would be split out too, but that's a
> lot more code duplication.
That looks OK, but please add a ChangeLog next time.
Thanks,
Siddhesh