This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH 05/11] A pointer to a pointer is nonnull.
- From: Peter Foley <pefoley2 at pefoley dot com>
- To: cygwin-patches at cygwin dot com
- Cc: Peter Foley <pefoley2 at pefoley dot com>
- Date: Sat, 19 Mar 2016 13:45:51 -0400
- Subject: [PATCH 05/11] A pointer to a pointer is nonnull.
- Authentication-results: sourceware.org; auth=none
- References: <1458409557-13156-1-git-send-email-pefoley2 at pefoley dot com>
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 <pefoley2@pefoley.com>
---
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