]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Get rid of warning comparision will always evaluate as true
authorStefan Liebler <stli@linux.vnet.ibm.com>
Fri, 12 Dec 2014 10:13:09 +0000 (11:13 +0100)
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Fri, 12 Dec 2014 10:14:00 +0000 (11:14 +0100)
ChangeLog
nptl/tst-mutex6.c
nptl/tst-mutexpp6.c

index 53995f98571ed62a569425090272e5f98e779d0d..9f18f4e95e4609d4c0530bfbd93608ea9de6ffc5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-12-12  Stefan Liebler  <stli@linux.vnet.ibm.com>
+
+       * nptl/tst-mutex6.c
+       (ATTR_NULL): New define checks ATTR against NULL.
+       (do_test): Use !ATTR_NULL instead of ATTR != NULL.
+       * nptl/tst-mutexpp6.c (ATTR_NULL): New define.
+
 2014-12-11  James Lemke  <jwlemke@codesourcery.com>
 
        [BZ #17581]
 
 2014-12-11  Stefan Liebler  <stli@linux.vnet.ibm.com>
 
-       sysdeps/s390/s390-32/dl-machine.h (elf_machine_load_address):
+       sysdeps/s390/s390-32/dl-machine.h (elf_machine_load_address):
        Truncating assembler expression to a .long expression.
 
 2014-12-11  Andreas Schwab  <schwab@suse.de>
index 292e3bf06df8f664c176126297e49c371715bd97..9c11a20632dcf4176696bddc3056675f2b539608 100644 (file)
@@ -21,6 +21,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
+#include <stdbool.h>
 
 
 #ifndef ATTR
@@ -28,6 +29,9 @@ pthread_mutexattr_t *attr;
 # define ATTR attr
 #endif
 
+#ifndef ATTR_NULL
+# define ATTR_NULL (ATTR == NULL)
+#endif
 
 static int
 do_test (void)
@@ -35,7 +39,7 @@ do_test (void)
   pthread_mutex_t m;
 
   int e = pthread_mutex_init (&m, ATTR);
-  if (ATTR != NULL && e == ENOTSUP)
+  if (!ATTR_NULL && e == ENOTSUP)
     {
       puts ("cannot support selected type of mutexes");
       e = pthread_mutex_init (&m, NULL);
@@ -46,7 +50,7 @@ do_test (void)
       return 1;
     }
 
-  if (ATTR != NULL && pthread_mutexattr_destroy (ATTR) != 0)
+  if (!ATTR_NULL && pthread_mutexattr_destroy (ATTR) != 0)
     {
       puts ("mutexattr_destroy failed");
       return 1;
index 2ddf6b45c6856cc47bfe14a5bdad74a971accc56..87a6ebd74c65366430fafc50ba3f152e59426135 100644 (file)
@@ -42,4 +42,5 @@ do_test_wrapper (void)
 #define TEST_FUNCTION do_test_wrapper ()
 
 #define ATTR &a
+#define ATTR_NULL false
 #include "tst-mutex6.c"