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: Joseph Myers <joseph at codesourcery dot com>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: Paul Pluzhnikov <ppluzhnikov at gmail dot com>, GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Sun, 1 Mar 2015 22:22:33 +0000
- 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> <20150301191032 dot GA19363 at vapier>
On Sun, 1 Mar 2015, Mike Frysinger wrote:
> On 28 Feb 2015 14:03, Paul Pluzhnikov wrote:
> > +# if __GNUC_PREREQ(4,9)
> > + __attribute__((returns_nonnull))
> > +# endif
>
> repeating this everywhere is ugly. update misc/sys/cdefs.h instead to create a
> dedicated attribute define based on version, and then apply that define to all
> the headers w/out any version checks.
Also, returns_nonnull is in the user namespace - this should have shown up
in regression testing as conform/ test failures. You need to use
__returns_nonnull__. And remember the space before the first '('.
--
Joseph S. Myers
joseph@codesourcery.com