This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, MIPS] Fix warning from malloc/malloc.c


Here is a fix for another warning (now error) found in my MIPS build.

	malloc.c: In function '__posix_memalign':
	malloc.c:4976:50: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses]
		|| !powerof2 (alignment / sizeof (void *)) != 0
                                                  ^
	cc1: all warnings being treated as errors


The fix is to remove the '!= 0' comparision since it is redundant.

OK to checkin?

Steve Ellcey
sellcey@imgtec.com

2014-12-10  Steve Ellcey  <sellcey@imgtec.com>

	* malloc/malloc.c: Fix powerof2 check.


diff --git a/malloc/malloc.c b/malloc/malloc.c
index 6bfb859..cb91b97 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -4973,7 +4973,7 @@ __posix_memalign (void **memptr, size_t alignment, size_t size)
   /* Test whether the SIZE argument is valid.  It must be a power of
      two multiple of sizeof (void *).  */
   if (alignment % sizeof (void *) != 0
-      || !powerof2 (alignment / sizeof (void *)) != 0
+      || !powerof2 (alignment / sizeof (void *))
       || alignment == 0)
     return EINVAL;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]