This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [patch] For BZ #17328, mark __errno_location with __attribute__((returns_nonnull)) for gcc >=4.9.0
- From: Paul Pluzhnikov <ppluzhnikov at gmail dot com>
- To: Rich Felker <dalias at libc dot org>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>, Zack Weinberg <zackw at panix dot com>
- Date: Sat, 28 Feb 2015 17:54:23 -0800
- Subject: Re: [patch] For BZ #17328, mark __errno_location with __attribute__((returns_nonnull)) for gcc >=4.9.0
- Authentication-results: sourceware.org; auth=none
- References: <CALoOobOuAEpw+zxRrrDyHB7UVbAZMzreXqpujzZOWNLS7+aRUA at mail dot gmail dot com> <20150301011753 dot GV23507 at brightrain dot aerifal dot cx>
+cc zackw@panix.com
On Sat, Feb 28, 2015 at 5:17 PM, Rich Felker <dalias@libc.org> wrote:
> On Sat, Feb 28, 2015 at 02:03:11PM -0800, Paul Pluzhnikov wrote:
>> Greetings,
>>
>> Tested on Linux/x86_64 with gcc-4.8 and 5.0.
>
> No objection, but I'm curious if there's any practical benefit of
> this. I can't think of many situations where knowledge that
> &errno!=NULL would assist the compiler in optimizing or diagnostics.
Hmm, maybe you are right.
I was reading https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58689 and
threads linked from it, and it really looks like not much is gained
inside (or outside) GLIBC -- it's not like anyone ever checks whether
__errno_location() returned NULL.
Zack,
Do you have any additional motivation for filing
https://sourceware.org/bugzilla/show_bug.cgi?id=17328
Thanks!
--
Paul Pluzhnikov