This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use an alias to `ptsname_r' in login/tst-ptsname.c
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Arjun Shankar <arjun dot is at lostca dot se>
- Cc: <libc-alpha at sourceware dot org>
- Date: Wed, 24 May 2017 16:18:15 +0000
- Subject: Re: [PATCH] Use an alias to `ptsname_r' in login/tst-ptsname.c
- Authentication-results: sourceware.org; auth=none
- References: <20170524155000.GA45792@aloka.lostca.se>
On Wed, 24 May 2017, Arjun Shankar wrote:
> When compiled with `-O3', inlining causes GCC to realize that one of the
> tests calls `ptsname_r' with a NULL buffer and error out when compiling
> with -Wnonnull.
>
> Declare `ptsname_r_alias' and alias it to `ptsname_r' to avoid this.
Normally in such cases we'd use the DIAG_* macros from libc-diag.h, with
appropriate comments, to disable the specific warning for the code in
question.
--
Joseph S. Myers
joseph@codesourcery.com