public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH v2 1/5] Add nonnull annotation to posix_memalign.
  2016-03-21 15:52           ` Peter Foley
@ 2016-03-21 17:16 Peter Foley
  2016-03-19 17:46 ` [PATCH 01/11] Remove unused and unsafe call to __builtin_frame_address Peter Foley
                   ` (5 more replies)
  -1 siblings, 6 replies; 77+ messages in thread
From: Peter Foley @ 2016-03-21 17:16 UTC (permalink / raw)
  To: cygwin-patches; +Cc: Peter Foley

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
 
diff --git a/winsup/cygwin/malloc_wrapper.cc b/winsup/cygwin/malloc_wrapper.cc
index 43b8144..0db5de8 100644
--- a/winsup/cygwin/malloc_wrapper.cc
+++ b/winsup/cygwin/malloc_wrapper.cc
@@ -126,8 +126,7 @@ posix_memalign (void **memptr, size_t alignment, size_t bytes)
   __malloc_unlock ();
   if (!res)
     return ENOMEM;
-  if (memptr)
-    *memptr = res;
+  *memptr = res;
   return 0;
 }
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 77+ messages in thread

end of thread, other threads:[~2016-03-30 15:07 UTC | newest]

Thread overview: 77+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-21 17:16 [PATCH v2 1/5] Add nonnull annotation to posix_memalign Peter Foley
2016-03-19 17:46 ` [PATCH 01/11] Remove unused and unsafe call to __builtin_frame_address Peter Foley
2016-03-19 17:46   ` [PATCH 04/11] Remove misleading indentation Peter Foley
2016-03-20 11:03     ` Corinna Vinschen
2016-03-21 17:16       ` [PATCH v2 3/5] " Peter Foley
2016-03-21 19:17         ` Corinna Vinschen
2016-03-19 17:46   ` [PATCH 08/11] Fix typoed comparison Peter Foley
2016-03-20 11:20     ` Corinna Vinschen
2016-03-19 17:46   ` [PATCH 09/11] Add c++14 sized deallocation operator Peter Foley
2016-03-20 11:28     ` Corinna Vinschen
2016-03-21 16:35       ` Peter Foley
2016-03-21 17:13         ` Corinna Vinschen
2016-03-21 17:47           ` Peter Foley
2016-03-21 18:09             ` Corinna Vinschen
2016-03-21 19:35               ` Peter Foley
2016-03-21 19:55                 ` Corinna Vinschen
2016-03-21 20:04                   ` Peter Foley
2016-03-23 11:07                     ` Corinna Vinschen
2016-03-19 17:46   ` [PATCH 06/11] Remove always true nonnull check on "this" pointer Peter Foley
2016-03-29 20:50     ` Peter Foley
2016-03-30 11:24     ` Corinna Vinschen
2016-03-30 13:11       ` Peter Foley
2016-03-19 17:46   ` [PATCH 03/11] Add necessary braces to if statements Peter Foley
2016-03-20 10:56     ` Corinna Vinschen
2016-03-19 17:46   ` [PATCH 07/11] The address of an class always evaluates to true Peter Foley
2016-03-20 11:17     ` Corinna Vinschen
2016-03-19 17:46   ` [PATCH 02/11] Remove dead code from fhandler_console Peter Foley
2016-03-20 10:57     ` Corinna Vinschen
2016-03-19 17:46   ` [PATCH 11/11] respect datarootdir Peter Foley
2016-03-20 11:49     ` Corinna Vinschen
2016-03-19 17:46   ` [PATCH 10/11] Fix strict aliasing Peter Foley
2016-03-20 11:34     ` Corinna Vinschen
2016-03-19 17:46   ` [PATCH 05/11] A pointer to a pointer is nonnull Peter Foley
2016-03-20 11:16     ` Corinna Vinschen
2016-03-21 14:20       ` Peter Foley
2016-03-21 15:05         ` Corinna Vinschen
2016-03-21 15:52           ` Peter Foley
2016-03-21 16:38       ` Peter Rosin
2016-03-21 19:49         ` Corinna Vinschen
2016-03-20  9:56   ` [PATCH 01/11] Remove unused and unsafe call to __builtin_frame_address Corinna Vinschen
2016-03-21  1:44     ` Peter Foley
2016-03-20 10:54   ` Corinna Vinschen
2016-03-21 17:16 ` [PATCH 5/5] Add with-only-headers Peter Foley
2016-03-21 19:48   ` Corinna Vinschen
2016-03-21 19:59     ` Peter Foley
2016-03-21 20:32       ` Corinna Vinschen
2016-03-21 20:35         ` Peter Foley
2016-03-21 21:04         ` Peter Foley
2016-03-21 21:30           ` Peter Foley
2016-03-23 10:44             ` Corinna Vinschen
2016-03-23 13:34             ` [PATCH 2/3] " Peter Foley
2016-03-21 17:16 ` [PATCH 2/5] Link against libdnsapi to avoid undefined reference Peter Foley
2016-03-21 19:25   ` Corinna Vinschen
2016-03-21 19:46     ` Peter Foley
2016-03-21 19:52       ` Corinna Vinschen
2016-03-21 20:04         ` Peter Foley
2016-03-21 20:19         ` Peter Foley
2016-03-21 20:34           ` Corinna Vinschen
2016-03-21 20:41             ` [PATCH v2] Use DnsFree instead of deprecated DnsRecordListFree Peter Foley
2016-03-23 10:43               ` Corinna Vinschen
2016-03-21 17:16 ` [PATCH 4/5] Don't build utils/lsaauth when cross compiling Peter Foley
2016-03-21 19:30   ` Corinna Vinschen
2016-03-21 19:52     ` Peter Foley
2016-03-21 19:58       ` Corinna Vinschen
2016-03-21 20:00         ` Peter Foley
2016-03-22  1:49           ` Yaakov Selkowitz
2016-03-22  4:04             ` Peter Foley
2016-03-23 13:34             ` [PATCH v2 1/3] Add option to not build mingw programs " Peter Foley
2016-03-23 13:34               ` [PATCH 3/3] Use just-built gcc for windres Peter Foley
2016-03-30 12:31                 ` Corinna Vinschen
2016-03-30 13:09                   ` Peter Foley
2016-03-30 15:07                 ` Corinna Vinschen
2016-03-30 12:11               ` [PATCH v2 1/3] Add option to not build mingw programs when cross compiling Corinna Vinschen
2016-03-30 13:10                 ` Peter Foley
2016-03-21 19:28 ` [PATCH v2 1/5] Add nonnull annotation to posix_memalign Corinna Vinschen
2016-03-22  1:51 ` Yaakov Selkowitz
2016-03-23 10:46   ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).