[patch] For BZ #17328, mark __errno_location with __attribute__((returns_nonnull)) for gcc >=4.9.0

Joseph Myers joseph@codesourcery.com
Sun Mar 1 22:22:00 GMT 2015


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



More information about the Libc-alpha mailing list