This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.20-292-g4e0b901
- From: jsm28 at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 2 Dec 2014 22:34:30 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.20-292-g4e0b901
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 4e0b901601038c863b97e68b18ae50a82e10a157 (commit)
from b1aff6a41120c1d9cedc1ecedeafc79f161ce982 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4e0b901601038c863b97e68b18ae50a82e10a157
commit 4e0b901601038c863b97e68b18ae50a82e10a157
Author: Joseph Myers <joseph@codesourcery.com>
Date: Tue Dec 2 22:33:57 2014 +0000
Fix -Waddress warnings in nptl/tst-mutex1.c.
This patch fixes -Waddress warnings in nptl/tst-mutex1.c from
comparing the address of an object with NULL (ATTR may either be NULL,
or the address of an object when included from other tests, and the
warning arises in the latter case). A macro ATTR_NULL is defined
alongside ATTR and used for the tests.
Tested for x86_64.
* nptl/tst-mutex1.c: Include <stdbool.h>.
[!ATTR] (ATTR_NULL): New macro.
(do_test): Test !ATTR_NULL instead of ATTR != NULL.
* nptl/tst-mutexpi1.c (ATTR_NULL): New macro.
* nptl/tst-mutexpp1.c (ATTR_NULL): New macro.
diff --git a/ChangeLog b/ChangeLog
index c6ee845..51df3b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2014-12-02 Joseph Myers <joseph@codesourcery.com>
+ * nptl/tst-mutex1.c: Include <stdbool.h>.
+ [!ATTR] (ATTR_NULL): New macro.
+ (do_test): Test !ATTR_NULL instead of ATTR != NULL.
+ * nptl/tst-mutexpi1.c (ATTR_NULL): New macro.
+ * nptl/tst-mutexpp1.c (ATTR_NULL): New macro.
+
* posix/tst-getopt_long1.c (do_test): Cast elements of argv array
to char *.
diff --git a/nptl/tst-mutex1.c b/nptl/tst-mutex1.c
index 2a181e5..27ce54f 100644
--- a/nptl/tst-mutex1.c
+++ b/nptl/tst-mutex1.c
@@ -19,10 +19,12 @@
#include <pthread.h>
#include <stdio.h>
#include <errno.h>
+#include <stdbool.h>
#ifndef ATTR
# define ATTR NULL
+# define ATTR_NULL true
#endif
@@ -32,7 +34,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");
return 0;
@@ -43,7 +45,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-mutexpi1.c b/nptl/tst-mutexpi1.c
index 623ede9..d768664 100644
--- a/nptl/tst-mutexpi1.c
+++ b/nptl/tst-mutexpi1.c
@@ -24,4 +24,5 @@ prepare (void)
#define ATTR &a
+#define ATTR_NULL false
#include "tst-mutex1.c"
diff --git a/nptl/tst-mutexpp1.c b/nptl/tst-mutexpp1.c
index 9b7d7fe..8ec4673 100644
--- a/nptl/tst-mutexpp1.c
+++ b/nptl/tst-mutexpp1.c
@@ -42,4 +42,5 @@ do_test_wrapper (void)
#define TEST_FUNCTION do_test_wrapper ()
#define ATTR &a
+#define ATTR_NULL false
#include "tst-mutex1.c"
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
nptl/tst-mutex1.c | 6 ++++--
nptl/tst-mutexpi1.c | 1 +
nptl/tst-mutexpp1.c | 1 +
4 files changed, 12 insertions(+), 2 deletions(-)
hooks/post-receive
--
GNU C Library master sources