aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorStefan Liebler <stli@linux.vnet.ibm.com>2014-12-12 11:13:09 +0100
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2014-12-12 11:14:00 +0100
commit9d9c0019e750b6ef2f6d941e40a4b959c736653c (patch)
tree5a9df2c0f1785f65d4a0c1c2e44ab9a355bbdc03 /nptl
parent9173840b4dbcd1a76993f22fd9595f0ae30d5a42 (diff)
downloadglibc-9d9c0019e750b6ef2f6d941e40a4b959c736653c.tar
glibc-9d9c0019e750b6ef2f6d941e40a4b959c736653c.tar.gz
glibc-9d9c0019e750b6ef2f6d941e40a4b959c736653c.tar.bz2
glibc-9d9c0019e750b6ef2f6d941e40a4b959c736653c.zip
Get rid of warning comparision will always evaluate as true
Diffstat (limited to 'nptl')
-rw-r--r--nptl/tst-mutex6.c8
-rw-r--r--nptl/tst-mutexpp6.c1
2 files changed, 7 insertions, 2 deletions
diff --git a/nptl/tst-mutex6.c b/nptl/tst-mutex6.c
index 292e3bf06d..9c11a20632 100644
--- a/nptl/tst-mutex6.c
+++ b/nptl/tst-mutex6.c
@@ -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;
diff --git a/nptl/tst-mutexpp6.c b/nptl/tst-mutexpp6.c
index 2ddf6b45c6..87a6ebd74c 100644
--- a/nptl/tst-mutexpp6.c
+++ b/nptl/tst-mutexpp6.c
@@ -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"