[PATCH v2 1/5] Add nonnull annotation to posix_memalign.

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Mar 23 10:46:00 GMT 2016


On Mar 21 20:51, Yaakov Selkowitz wrote:
> On 2016-03-21 12:15, Peter Foley wrote:
> >GCC 6.0+ asserts that the memptr argument to the builtin function
> >posix_memalign is nonnull.
> >Add the necessary annotation to the prototype and
> >remove the now unnecessary check to fix a warning.
> >
> >newlib/Changelog
> >newlib/libc/include/stdlib.h: Annotate arg to posix_memalign as
> >non-null.
> >
> >winsup/cygwin/ChangeLog
> >malloc_wrapper.cc (posix_memalign): Remove always true nonnull check.
> >
> >Signed-off-by: Peter Foley <pefoley2@pefoley.com>
> >---
> >  newlib/libc/include/stdlib.h    | 2 +-
> >  winsup/cygwin/malloc_wrapper.cc | 3 +--
> >  2 files changed, 2 insertions(+), 3 deletions(-)
> >
> >diff --git a/newlib/libc/include/stdlib.h b/newlib/libc/include/stdlib.h
> >index f4b2626..7d4ae76 100644
> >--- a/newlib/libc/include/stdlib.h
> >+++ b/newlib/libc/include/stdlib.h
> >@@ -253,7 +253,7 @@ int	_EXFUN(_unsetenv_r,(struct _reent *, const char *__string));
> >
> >  #ifdef __rtems__
> >  #if __POSIX_VISIBLE >= 200112
> >-int _EXFUN(posix_memalign,(void **, size_t, size_t));
> >+int _EXFUN(__nonnull (1) posix_memalign,(void **, size_t, size_t));
> >  #endif
> >  #endif
> 
> Note the ifdef __rtems__ there; we have our own posix_memalign declaration
> in winsup/cygwin/include/cygwin/stdlib.h.  Perhaps these should be merged?

Definitely.  Thanks for catching.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20160323/b5ce3ab7/attachment.sig>


More information about the Cygwin-patches mailing list