This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PING][PATCH v2] Remove check for NULL buffer passed to `ptsname_r'
- From: Florian Weimer <fweimer at redhat dot com>
- To: Zack Weinberg <zackw at panix dot com>, Arjun Shankar <arjun dot is at lostca dot se>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, Joseph Myers <joseph at codesourcery dot com>
- Date: Wed, 7 Jun 2017 15:59:34 +0200
- Subject: Re: [PING][PATCH v2] Remove check for NULL buffer passed to `ptsname_r'
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2FF8780474
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2FF8780474
- References: <20170607115039.GB65837@aloka.lostca.se> <CAKCAbMiO4iy9_jLFKbWfKumo8=VpQTkg1hr2noM06g1DDcBtqg@mail.gmail.com>
On 06/07/2017 03:39 PM, Zack Weinberg wrote:
>> `ptsname_r' is declared in stdlib.h to only accept a `nonnull'
>> second argument and therefore GCC may choose to make optimizations
>> based on the assumption that this argument is NULL. This means
>> that potentially, GCC can optimize away the NULL check at some
>> point in the future. Since this is a programming interface, we
>> might as well remove the NULL check ourselves.
>>
>> This also warrants a change to the `ptsname_r' manual page that
>> must be submitted to the corresponding mailing list.
>
> Is this function documented in our manual (manual/*.texi)? If so,
> please update that.
Our manual doesn't say what happens with a NULL buffer, so no update is
needed.
> OK with that change. I don't think we need a copyright assignment for
> a change that deletes seven lines of code and adds none.
Arjun's work is covered.
Thanks,
Florian