GCC 6.0+ can assert that this argument is nonnull.
Remove the unnecessary check to fix a warning.

winsup/cygwin/ChangeLog
malloc_wrapper.cc (posix_memalign): Remove always true nonnull check.

Signed-off-by: Peter Foley <[email protected]>
---
 winsup/cygwin/malloc_wrapper.cc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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

Reply via email to